Closed awasilik closed 11 months ago
NavigationPage and Shell are two different navigations systems and cannot be use mixed like you are trying here
Please read this page to be clear: https://adospace.gitbook.io/mauireactor/components/navigation
This is not what I wanted to show. I just wanted to show that in both examples this doesn't work. This is just a sandbox and of course I am not mixing those approaches in my app
Edited
Hi, thank you for reporting this. I've fixed the problem with the NavigationPage. Regarding the Shell navigation system, I'm afraid that the OnWillOnmount() can't be called on the component creating the page because it's directly handled by the shell.
The workaround is to attach/detach the Appearing event:
return new ContentPage("Home")
{
new Label("Home")
.VCenter()
.HCenter()
}
.OnAppearing(()=> System.Diagnostics.Debug.WriteLine("HomePage.OnAppearing()"))
.OnDisappearing(() => System.Diagnostics.Debug.WriteLine("HomePage.OnDisappearing()"));
Hey,
I'm playing around with the framework and I noticed that OnWillUnmount is not called by the framework when going back from Page using Back button using
Disclaimer: I have tested it with both Navigation and Shell. Below there is and example how it doesn't not work in
Navigation andShell approach, this is not a code I have in my app.Quick sandbox code
Edit - for Navigation there is a workaround, but for Shell there is none.