In my app, on initializing a page (let's call it FirstPage) I check for some conditions and, if necessary, want to display a warning page (let's call it WarningPage). The content of this page will be too complicated for Alert Boxes - with links and some formatting.
I tried to call Shell.Current.GoToAsync("WarningPage"); but I did not find the appropriate moment to do this. If called in OnAppearing(), WarningPage shows up after I close MainPage.
What I want is that the navigation stack contains FirstPage -> WarningPage -> (perhaps a third page by clicking on a link in WarningPage) and he gets back to FirstPage when he closes the WarningPage.
Edit: No errors occur in MainPage but WarningPage shows up after I close MainPage.
I seemed to solve it, but not for all cases: I use the
Appearingevent inFirstPage:In this event I use
Navigation.PushModalAsync:This does what I want but not really:
This works only for one of my pages, unfortunately not for the page where I actually need this feature. So - who can tell me a way that always works to programmatrically switch from one page to a second one and allow to use the Back function to go back to the first page?
When I have time, I'll try to find out under what circumstances it works and what I have to do otherwise.