Skip to content

Commit 691cb9f

Browse files
Fixes app navigation (#1573)
1 parent b0a18b9 commit 691cb9f

9 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/MAUI/Maui.Samples/AppShell.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ private async Task CheckApiKey()
3636
ApiKeyStatus status = await ApiKeyManager.CheckKeyValidity();
3737
if (status != ApiKeyStatus.Valid)
3838
{
39-
await Navigation.PushAsync(new ApiKeyPage(), true);
39+
await Shell.Current.Navigation.PushAsync(new ApiKeyPage(), true);
4040
}
4141
}
4242
#endregion

src/MAUI/Maui.Samples/Samples/Layers/ChangeSublayerVisibility/ChangeSublayerVisibility.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ private async void OnSublayersClicked(object sender, EventArgs e)
9898
};
9999

100100
// Navigate to the sublayers page
101-
await Navigation.PushAsync(sublayersPage);
101+
await Shell.Current.Navigation.PushAsync(sublayersPage);
102102
}
103103
catch (Exception ex)
104104
{

src/MAUI/Maui.Samples/Samples/Layers/IdentifyKmlFeatures/IdentifyKmlFeatures.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ private async void MyMapView_GeoViewTapped(object sender, Esri.ArcGISRuntime.Mau
8080
}
8181

8282
// Show a page with the HTML content
83-
await Navigation.PushAsync(new KmlIdentifyResultDisplayPage(firstIdentifiedPlacemark.BalloonContent));
83+
await Shell.Current.Navigation.PushAsync(new KmlIdentifyResultDisplayPage(firstIdentifiedPlacemark.BalloonContent), false);
8484
}
8585
catch (Exception ex)
8686
{

src/MAUI/Maui.Samples/Samples/Layers/WmsIdentify/WmsIdentify.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ private async void MyMapView_GeoViewTapped(object sender, Esri.ArcGISRuntime.Mau
101101
}
102102

103103
// Show a page with the HTML content
104-
await Navigation.PushAsync(new WmsIdentifyResultDisplayPage(htmlContent));
104+
await Shell.Current.Navigation.PushAsync(new WmsIdentifyResultDisplayPage(htmlContent));
105105
}
106106
catch (Exception ex)
107107
{

src/MAUI/Maui.Samples/Samples/Map/AuthorMap/AuthorMap.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ private void ShowSaveMapUI(object sender, EventArgs e)
7979
mapInputForm.OnSaveClicked += SaveMapAsync;
8080

8181
// Navigate to the SaveMapPage UI.
82-
Navigation.PushAsync(mapInputForm);
82+
Shell.Current.Navigation.PushAsync(mapInputForm);
8383
}
8484

8585
// Event handler to get information entered by the user and save the map.

src/MAUI/Maui.Samples/Samples/Map/ManageBookmarks/ManageBookmarks.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ private async void ButtonAddBookmark_Clicked(object sender, EventArgs e)
9494
try
9595
{
9696
// Prompt the user for the new bookmark name.
97-
string name = await DisplayPromptAsync("New bookmark", "Enter name for new bookmark");
97+
string name = await Application.Current.Windows[0].Page.DisplayPromptAsync("New bookmark", "Enter name for new bookmark");
9898

9999
// Exit if the name is empty
100100
if (string.IsNullOrEmpty(name))

src/MAUI/Maui.Samples/Samples/NetworkAnalysis/RouteAroundBarriers/RouteAroundBarriers.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ private void ShowDirections_Clicked(object sender, EventArgs e)
307307

308308
private async Task ShowDirectionsTask()
309309
{
310-
await Navigation.PushAsync(_directionsPage);
310+
await Shell.Current.Navigation.PushAsync(_directionsPage);
311311
}
312312

313313
private async Task<PictureMarkerSymbol> GetPictureMarker()

src/MAUI/Maui.Samples/Samples/Security/TokenSecuredChallenge/TokenSecuredChallenge.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ private async Task<Credential> CreateCredentialAsync(CredentialRequestInfo info)
9797

9898
// Show the login controls on the UI thread.
9999
// OnLoginInfoEntered event will return the values entered (username and password).
100-
Microsoft.Maui.ApplicationModel.MainThread.BeginInvokeOnMainThread(async () => await Navigation.PushAsync(_loginPage));
100+
Microsoft.Maui.ApplicationModel.MainThread.BeginInvokeOnMainThread(async () => await Shell.Current.Navigation.PushAsync(_loginPage));
101101

102102
// Return the login task, the result will be ready when completed (user provides login info and clicks the "Login" button)
103103
return await _loginTaskCompletionSrc.Task;

src/MAUI/Maui.Samples/Views/CategoryPage.xaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ private async void FeedbackToolbarItem_Clicked(object sender, EventArgs e)
6060

6161
private async void SettingsClicked(object sender, EventArgs e)
6262
{
63-
await Navigation.PushAsync(new SettingsPage(), true);
63+
await Shell.Current.Navigation.PushAsync(new SettingsPage(), true);
6464
}
6565

6666
private async void SearchClicked(object sender, EventArgs e)
6767
{
68-
await Navigation.PushAsync(new SearchPage(), false);
68+
await Shell.Current.Navigation.PushAsync(new SearchPage(), false);
6969
}
7070

7171
// The favorites icon can flicker when using a pen as pointer.

0 commit comments

Comments
 (0)