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
@@ -198,6 +198,26 @@ public partial class CalendarAppShellViewModel : CalendarBaseViewModel,
_calendarPageViewModel.CleanupForShellDeactivation();
}
public void PrepareForShellShutdown()
{
DetachRuntimeSubscriptions();
PreferencesService.PreferenceChanged -= PreferencesServiceChanged;
if (_hasRegisteredPersistentRecipients)
{
UnregisterRecipients();
_hasRegisteredPersistentRecipients = false;
}
DateNavigationHeaderItems.Clear();
SelectedDateNavigationHeaderIndex = -1;
SelectedMenuItemIndex = -1;
MenuItems?.Clear();
FooterItems?.Clear();
AccountCalendarStateService.ClearGroupedAccountCalendars();
_calendarPageViewModel.CleanupForShellDeactivation();
}
private void AttachRuntimeSubscriptions()
{
if (_runtimeSubscriptionsAttached)