diff --git a/src/MAUI/Maui.Samples/AppShell.xaml.cs b/src/MAUI/Maui.Samples/AppShell.xaml.cs index c9656896b7..fe72ac9415 100644 --- a/src/MAUI/Maui.Samples/AppShell.xaml.cs +++ b/src/MAUI/Maui.Samples/AppShell.xaml.cs @@ -36,7 +36,7 @@ private async Task CheckApiKey() ApiKeyStatus status = await ApiKeyManager.CheckKeyValidity(); if (status != ApiKeyStatus.Valid) { - await Navigation.PushAsync(new ApiKeyPage(), true); + await Shell.Current.Navigation.PushAsync(new ApiKeyPage(), true); } } #endregion diff --git a/src/MAUI/Maui.Samples/Samples/Layers/ChangeSublayerVisibility/ChangeSublayerVisibility.xaml.cs b/src/MAUI/Maui.Samples/Samples/Layers/ChangeSublayerVisibility/ChangeSublayerVisibility.xaml.cs index aaf852f8ac..d5f5b4a935 100644 --- a/src/MAUI/Maui.Samples/Samples/Layers/ChangeSublayerVisibility/ChangeSublayerVisibility.xaml.cs +++ b/src/MAUI/Maui.Samples/Samples/Layers/ChangeSublayerVisibility/ChangeSublayerVisibility.xaml.cs @@ -98,7 +98,7 @@ private async void OnSublayersClicked(object sender, EventArgs e) }; // Navigate to the sublayers page - await Navigation.PushAsync(sublayersPage); + await Shell.Current.Navigation.PushAsync(sublayersPage); } catch (Exception ex) { diff --git a/src/MAUI/Maui.Samples/Samples/Layers/IdentifyKmlFeatures/IdentifyKmlFeatures.xaml.cs b/src/MAUI/Maui.Samples/Samples/Layers/IdentifyKmlFeatures/IdentifyKmlFeatures.xaml.cs index f288108f6b..3ead52a2d4 100644 --- a/src/MAUI/Maui.Samples/Samples/Layers/IdentifyKmlFeatures/IdentifyKmlFeatures.xaml.cs +++ b/src/MAUI/Maui.Samples/Samples/Layers/IdentifyKmlFeatures/IdentifyKmlFeatures.xaml.cs @@ -80,7 +80,7 @@ private async void MyMapView_GeoViewTapped(object sender, Esri.ArcGISRuntime.Mau } // Show a page with the HTML content - await Navigation.PushAsync(new KmlIdentifyResultDisplayPage(firstIdentifiedPlacemark.BalloonContent)); + await Shell.Current.Navigation.PushAsync(new KmlIdentifyResultDisplayPage(firstIdentifiedPlacemark.BalloonContent), false); } catch (Exception ex) { diff --git a/src/MAUI/Maui.Samples/Samples/Layers/WmsIdentify/WmsIdentify.xaml.cs b/src/MAUI/Maui.Samples/Samples/Layers/WmsIdentify/WmsIdentify.xaml.cs index d44635abb5..3dff691af3 100644 --- a/src/MAUI/Maui.Samples/Samples/Layers/WmsIdentify/WmsIdentify.xaml.cs +++ b/src/MAUI/Maui.Samples/Samples/Layers/WmsIdentify/WmsIdentify.xaml.cs @@ -101,7 +101,7 @@ private async void MyMapView_GeoViewTapped(object sender, Esri.ArcGISRuntime.Mau } // Show a page with the HTML content - await Navigation.PushAsync(new WmsIdentifyResultDisplayPage(htmlContent)); + await Shell.Current.Navigation.PushAsync(new WmsIdentifyResultDisplayPage(htmlContent)); } catch (Exception ex) { diff --git a/src/MAUI/Maui.Samples/Samples/Map/AuthorMap/AuthorMap.xaml.cs b/src/MAUI/Maui.Samples/Samples/Map/AuthorMap/AuthorMap.xaml.cs index 3e4a41480c..f84cf89c25 100644 --- a/src/MAUI/Maui.Samples/Samples/Map/AuthorMap/AuthorMap.xaml.cs +++ b/src/MAUI/Maui.Samples/Samples/Map/AuthorMap/AuthorMap.xaml.cs @@ -79,7 +79,7 @@ private void ShowSaveMapUI(object sender, EventArgs e) mapInputForm.OnSaveClicked += SaveMapAsync; // Navigate to the SaveMapPage UI. - Navigation.PushAsync(mapInputForm); + Shell.Current.Navigation.PushAsync(mapInputForm); } // Event handler to get information entered by the user and save the map. diff --git a/src/MAUI/Maui.Samples/Samples/Map/ManageBookmarks/ManageBookmarks.xaml.cs b/src/MAUI/Maui.Samples/Samples/Map/ManageBookmarks/ManageBookmarks.xaml.cs index dd76d4c335..a18b735a44 100644 --- a/src/MAUI/Maui.Samples/Samples/Map/ManageBookmarks/ManageBookmarks.xaml.cs +++ b/src/MAUI/Maui.Samples/Samples/Map/ManageBookmarks/ManageBookmarks.xaml.cs @@ -94,7 +94,7 @@ private async void ButtonAddBookmark_Clicked(object sender, EventArgs e) try { // Prompt the user for the new bookmark name. - string name = await DisplayPromptAsync("New bookmark", "Enter name for new bookmark"); + string name = await Application.Current.Windows[0].Page.DisplayPromptAsync("New bookmark", "Enter name for new bookmark"); // Exit if the name is empty if (string.IsNullOrEmpty(name)) diff --git a/src/MAUI/Maui.Samples/Samples/NetworkAnalysis/RouteAroundBarriers/RouteAroundBarriers.xaml.cs b/src/MAUI/Maui.Samples/Samples/NetworkAnalysis/RouteAroundBarriers/RouteAroundBarriers.xaml.cs index ca263d2c83..3b40c1e749 100644 --- a/src/MAUI/Maui.Samples/Samples/NetworkAnalysis/RouteAroundBarriers/RouteAroundBarriers.xaml.cs +++ b/src/MAUI/Maui.Samples/Samples/NetworkAnalysis/RouteAroundBarriers/RouteAroundBarriers.xaml.cs @@ -307,7 +307,7 @@ private void ShowDirections_Clicked(object sender, EventArgs e) private async Task ShowDirectionsTask() { - await Navigation.PushAsync(_directionsPage); + await Shell.Current.Navigation.PushAsync(_directionsPage); } private async Task GetPictureMarker() diff --git a/src/MAUI/Maui.Samples/Samples/Security/TokenSecuredChallenge/TokenSecuredChallenge.xaml.cs b/src/MAUI/Maui.Samples/Samples/Security/TokenSecuredChallenge/TokenSecuredChallenge.xaml.cs index aa59f36581..57bbebe783 100644 --- a/src/MAUI/Maui.Samples/Samples/Security/TokenSecuredChallenge/TokenSecuredChallenge.xaml.cs +++ b/src/MAUI/Maui.Samples/Samples/Security/TokenSecuredChallenge/TokenSecuredChallenge.xaml.cs @@ -97,7 +97,7 @@ private async Task CreateCredentialAsync(CredentialRequestInfo info) // Show the login controls on the UI thread. // OnLoginInfoEntered event will return the values entered (username and password). - Microsoft.Maui.ApplicationModel.MainThread.BeginInvokeOnMainThread(async () => await Navigation.PushAsync(_loginPage)); + Microsoft.Maui.ApplicationModel.MainThread.BeginInvokeOnMainThread(async () => await Shell.Current.Navigation.PushAsync(_loginPage)); // Return the login task, the result will be ready when completed (user provides login info and clicks the "Login" button) return await _loginTaskCompletionSrc.Task; diff --git a/src/MAUI/Maui.Samples/Views/CategoryPage.xaml.cs b/src/MAUI/Maui.Samples/Views/CategoryPage.xaml.cs index 0b60248c1c..8f0a595cff 100644 --- a/src/MAUI/Maui.Samples/Views/CategoryPage.xaml.cs +++ b/src/MAUI/Maui.Samples/Views/CategoryPage.xaml.cs @@ -60,12 +60,12 @@ private async void FeedbackToolbarItem_Clicked(object sender, EventArgs e) private async void SettingsClicked(object sender, EventArgs e) { - await Navigation.PushAsync(new SettingsPage(), true); + await Shell.Current.Navigation.PushAsync(new SettingsPage(), true); } private async void SearchClicked(object sender, EventArgs e) { - await Navigation.PushAsync(new SearchPage(), false); + await Shell.Current.Navigation.PushAsync(new SearchPage(), false); } // The favorites icon can flicker when using a pen as pointer.