FreshMvvm
FreshMvvm copied to clipboard
PopToRoot doesn't fire RaisePageWasPopped
Hi,
NavigationPage use an other event than "Popped" when we use PopToRoot.
I think method "AttachPageWasPoppedEvent" in FreshBasePageModel should be like that :
void AttachPageWasPoppedEvent() { var navPage = (this.CurrentPage.Parent as NavigationPage); if (navPage != null) { _alreadyAttached = true; navPage.Popped += HandleNavPagePopped; navPage.PoppedToRoot += HandleNavPagePoppedToRoot; } }`
And
void HandleNavPagePoppedToRoot(object sender, NavigationEventArgs e) { if (e.Page != this.CurrentPage) { RaisePageWasPopped(); } }
And of course unsubscribe in RaisePageWasPopped.
This code frees resources.
Can this be implemented? It would be very useful.
Is this still an issue?
I just wanted to use the Popped event and am worried about this old bug from 2016.