Handling some warnings and proper disposals of shells etc.

This commit is contained in:
Burak Kaan Köse
2026-03-27 14:45:36 +01:00
parent 3712041689
commit fb8a3d8f90
21 changed files with 470 additions and 298 deletions
@@ -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)