Reputation: 5114
I'm using an implementation of Master/Detail in my Forms app. The problem is that even after I change pages the previous one is still running, I even had to do some inactive/isActive code in order to stop the code execution of those pages.
This is how I change pages:
public void GoTo(Page page)
{
Detail = new NavigationPage(page);
IsPresented = false;
UserDialogs.Instance.HideLoading();
}
Then I do:
Application.Current.HomePage.GoTo(new ServiceSelectionPage());
But the previous page is kept running. What am I doing wrong? Or how do I remove those pages from memory? I tried setting Detail = null
to no avail.
Thanks!
Upvotes: 2
Views: 1137
Reputation: 7454
It is by design. You could:
GC.Collect();
- but it's not guaranteed. Upvotes: 1