Skip to content

Commit

Permalink
Merge pull request #549 from Esri/ncastle/adjust-forms-page-approach
Browse files Browse the repository at this point in the history
Changes to how page interactions work in Forms
  • Loading branch information
nCastle1 authored Oct 12, 2018
2 parents ec80a6c + eb6e01b commit 1937031
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
5 changes: 2 additions & 3 deletions src/Forms/Shared/Samples/Geometry/Buffer/Buffer.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private void Initialize()
ShowBufferSwatches(planarBufferColor, geodesicBufferColor);
}

private void MyMapView_GeoViewTapped(object sender, Esri.ArcGISRuntime.Xamarin.Forms.GeoViewInputEventArgs e)
private async void MyMapView_GeoViewTapped(object sender, Esri.ArcGISRuntime.Xamarin.Forms.GeoViewInputEventArgs e)
{
try
{
Expand Down Expand Up @@ -121,8 +121,7 @@ private void MyMapView_GeoViewTapped(object sender, Esri.ArcGISRuntime.Xamarin.F
catch (System.Exception ex)
{
// Display an error message if there is a problem generating the buffers.
Page currentPage = (App.Current.MainPage as NavigationPage).CurrentPage;
currentPage.DisplayAlert(ex.Message, "Error creating buffers", "OK");
await ((Page)Parent).DisplayAlert("Error creating buffers", ex.Message, "OK");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ private async void Initialize()
// Subscribe to notifications about leaving so that settings can be reset.
// This looks different because of sample viewer plumbing.
// Replace `((ArcGISRuntime.SamplePage)this.Parent)` with `this` in your app.
((ArcGISRuntime.SamplePage)this.Parent).Disappearing += SampleUnloaded;
((Page)this.Parent).Disappearing += SampleUnloaded;
}

private void SampleUnloaded(object sender, EventArgs e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,7 @@ private async void CommentsListBox_SelectionChanged(object sender, SelectedItemC
ArcGISFeature serviceRequestFeature = result.FirstOrDefault() as ArcGISFeature;
if (serviceRequestFeature == null)
{
Page currentPage = (App.Current.MainPage as NavigationPage).CurrentPage;
await currentPage.DisplayAlert("No Feature", "Related feature not found.", "OK");

await ((Page)Parent).DisplayAlert("No Feature", "Related feature not found.", "OK");
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ namespace ArcGISRuntime.Samples.TokenSecuredChallenge
"This sample demonstrates how to authenticate with ArcGIS Server using ArcGIS Tokens to access a secure service. Accessing secured services requires a login that's been defined on the server.",
"1. When you run the sample, the app will load a map that contains a layer from a secured service.\n2. You will be challenged for a user name and password to view that layer.\n3. Enter the correct user name (user1) and password (user1).\n4. If you authenticate successfully, the secured layer will display, otherwise the map will contain only the public layers.",
"Authentication, Security, ArcGIS Token")]
[ArcGISRuntime.Samples.Shared.Attributes.ClassFile("LoginPage.xaml.cs")]
[ArcGISRuntime.Samples.Shared.Attributes.XamlFiles("LoginPage.xaml")]
public partial class TokenSecuredChallenge : ContentPage
{
// Public and secured map service URLs.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ private async void Initialize()
catch (Exception ex)
{
// Something went wrong, display the error
//MessageBox.Show(ex.ToString());
await ((Page)Parent).DisplayAlert("Error",ex.ToString(), "OK");
}
}
Expand Down

0 comments on commit 1937031

Please sign in to comment.