Handling some warnings and proper disposals of shells etc.
This commit is contained in:
@@ -34,6 +34,12 @@ public sealed class ContactsShellClient(INavigationService navigationService) :
|
||||
public void Activate(ShellModeActivationContext activationContext)
|
||||
{
|
||||
OnNavigatedTo(NavigationMode.New, activationContext);
|
||||
|
||||
if (MenuItems?.Count == 0)
|
||||
{
|
||||
MenuItems.Add(_newContactMenuItem);
|
||||
}
|
||||
|
||||
navigationService.Navigate(WinoPage.ContactsPage, null, NavigationReferenceFrame.InnerShellFrame);
|
||||
}
|
||||
|
||||
@@ -42,6 +48,16 @@ public sealed class ContactsShellClient(INavigationService navigationService) :
|
||||
OnNavigatedFrom(NavigationMode.New, null!);
|
||||
}
|
||||
|
||||
public void PrepareForShellShutdown()
|
||||
{
|
||||
SelectedMenuItem = null;
|
||||
if (MenuItems != null)
|
||||
{
|
||||
MenuItems.Clear();
|
||||
MenuItems.Add(_newContactMenuItem);
|
||||
}
|
||||
}
|
||||
|
||||
public Task HandleNavigationItemInvokedAsync(IMenuItem? menuItem)
|
||||
{
|
||||
if (menuItem is NewContactMenuItem)
|
||||
|
||||
Reference in New Issue
Block a user