FreshMvvm icon indicating copy to clipboard operation
FreshMvvm copied to clipboard

PopToRoot doesn't fire RaisePageWasPopped

Open Sbou opened this issue 9 years ago • 2 comments

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.

Sbou avatar Jul 19 '16 09:07 Sbou

Can this be implemented? It would be very useful.

Emasoft avatar Sep 21 '16 09:09 Emasoft

Is this still an issue?

I just wanted to use the Popped event and am worried about this old bug from 2016.

acuntex avatar Dec 12 '20 13:12 acuntex