Simplified compoper and rendering logic through messages.

This commit is contained in:
Burak Kaan Köse
2026-02-25 01:41:48 +01:00
parent 5d46ea73db
commit 3a39266121
14 changed files with 157 additions and 108 deletions
+11 -3
View File
@@ -226,9 +226,17 @@ public partial class MailAppShellViewModel : MailBaseViewModel,
if (mode == NavigationMode.Back)
{
// Account list may have changed while this shell was inactive.
await RecreateMenuItemsAsync();
await RestoreSelectedAccountAfterMenuRefreshAsync(false);
// Preserve current mail/folder selection and active rendering page when
// switching back from Calendar mode. Recreating menu/folder state here
// causes a folder reload, which clears selection and disposes reader page.
// Rehydrate only if menu state is unexpectedly empty.
if (MenuItems?.Any() != true || FooterItems?.Any() != true)
{
await CreateFooterItemsAsync();
await RecreateMenuItemsAsync();
await RestoreSelectedAccountAfterMenuRefreshAsync(false);
}
return;
}