Reputation: 37
I have an app which has many pages and navigation is enabled between modal and non-modal pages . But somehow whenever I'm trying to set useModalNavigation property as false, it doesn't seem to work. Modal type navigation is suppressing the actual page navigation. Now my app has navigation between modals and root page. Any way out?
My app.xaml.cs has
await NavigationService.NavigateAsync(new Uri($"https://NavigationPage/{nameof(MyMainPage)}", UriKind.Absolute));
In MyMainPage I have a button which is further opening a content page. For this, i have a delegate command which is making below call to navigate to inner page on button click: navigationService.NavigateAsync("MyInnerPage", useModalNavigation:false);
Upvotes: 2
Views: 2621
Reputation: 2412
According to the Xamarin docs, not being able to navigate away from a modal page is expected behavior:
A modal page encourages users to complete a self-contained task that cannot be navigated away from until the task is completed or cancelled.
You need to pop the modal page to be able to navigate again:
await Navigation.PopModalAsync();
If you want to navigate away from this page, don't use modal navigation.
Upvotes: 1