You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had an issue with stuff not unsubscribing with Shell.
This happened because the unsubscription automaticly happend only on the navigation page, code:
if (sender is Application && e.PropertyName == "MainPage")
{
var page = (sender as Application).MainPage;
if (page is NavigationPage)
{
BindEvents(page as NavigationPage);
}
}
because of this i needed to update this method to this:
static void App_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
if (sender is Application && e.PropertyName == "MainPage")
{
var page = (sender as Application).MainPage;
if (page is NavigationPage)
{
BindEvents(page as NavigationPage);
}
else if (page is Shell s)
{
s.Navigating += Shell_Navigating;
}
}
}
private static void Shell_Navigating(object sender, ShellNavigatingEventArgs e)
{
if (e.Source == ShellNavigationSource.Pop
|| e.Source == ShellNavigationSource.Remove)
{
if (sender is Shell s)
{
UnsubscribePage(s.CurrentPage);
}
}
if (e.Source == ShellNavigationSource.PopToRoot)
{
if (sender is Shell s)
{
UnsubscribePage(s.CurrentPage);
}
}
if (e.Source == ShellNavigationSource.Unknown)
{
if(sender is Shell s)
{
if( !(s.CurrentPage is MainView) ) // On initial shell setup this is triggered..
{
UnsubscribePage(s.CurrentPage);
}
}
}
}
I can add this to a PR if you would like to review/merge it?
The text was updated successfully, but these errors were encountered:
Add it to a PR and we'll take a look at it and merge it if there are no issues with it. We do need to do some testing to make sure it doesn't break anything, but we'll try to be as quick as possible.
Hi, to start thanks for the framework.
I had an issue with stuff not unsubscribing with Shell.
This happened because the unsubscription automaticly happend only on the navigation page, code:
because of this i needed to update this method to this:
I can add this to a PR if you would like to review/merge it?
The text was updated successfully, but these errors were encountered: