Updating core title bar for menu item changes.
This commit is contained in:
@@ -64,6 +64,11 @@ public sealed partial class MailListPage : MailListPageAbstract,
|
||||
|
||||
Bindings.Update();
|
||||
|
||||
if (ViewModel.ActiveFolder != null)
|
||||
{
|
||||
ViewModel.StatePersistenceService.CoreWindowTitle = $"{ViewModel.ActiveFolder.AssignedAccountName} - {ViewModel.ActiveFolder.FolderName}";
|
||||
}
|
||||
|
||||
ViewModel.MailCollection.ItemSelectionChanged += WinoMailCollectionSelectionChanged;
|
||||
MailListView.MailDragStateChanged += MailListViewMailDragStateChanged;
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ public sealed partial class ManageAccountsPage : ManageAccountsPageAbstract,
|
||||
var accountManagementPageType = ViewModel.NavigationService.GetPageType(WinoPage.AccountManagementPage);
|
||||
|
||||
AccountPagesFrame.Navigate(accountManagementPageType, null, new SuppressNavigationTransitionInfo());
|
||||
UpdateWindowTitle();
|
||||
}
|
||||
|
||||
protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
|
||||
@@ -77,6 +78,7 @@ public sealed partial class ManageAccountsPage : ManageAccountsPageAbstract,
|
||||
PageHistory.ForEach(a => a.IsActive = false);
|
||||
|
||||
PageHistory.Add(new BreadcrumbNavigationItemViewModel(message, true));
|
||||
UpdateWindowTitle();
|
||||
}
|
||||
|
||||
private void AccountPagesFrameNavigated(object sender, NavigationEventArgs e)
|
||||
@@ -108,6 +110,7 @@ public sealed partial class ManageAccountsPage : ManageAccountsPageAbstract,
|
||||
|
||||
// Update back button visibility after navigation
|
||||
ViewModel.StatePersistenceService.IsManageAccountsNavigating = AccountPagesFrame.CanGoBack;
|
||||
UpdateWindowTitle();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,6 +139,7 @@ public sealed partial class ManageAccountsPage : ManageAccountsPageAbstract,
|
||||
DispatcherQueue.TryEnqueue(() =>
|
||||
{
|
||||
activePage.Title = message.Account.Name;
|
||||
UpdateWindowTitle();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -147,5 +151,14 @@ public sealed partial class ManageAccountsPage : ManageAccountsPageAbstract,
|
||||
if (activePage == null) return;
|
||||
|
||||
activePage.Title = message.NewName;
|
||||
UpdateWindowTitle();
|
||||
}
|
||||
|
||||
private void UpdateWindowTitle()
|
||||
{
|
||||
var activeTitle = PageHistory.LastOrDefault()?.Title;
|
||||
ViewModel.StatePersistenceService.CoreWindowTitle = string.IsNullOrWhiteSpace(activeTitle)
|
||||
? Translator.MenuManageAccounts
|
||||
: activeTitle;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,6 +52,8 @@ public sealed partial class SettingsPage : SettingsPageAbstract,
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
UpdateWindowTitle();
|
||||
}
|
||||
|
||||
public override void OnLanguageChanged()
|
||||
@@ -65,6 +67,7 @@ public sealed partial class SettingsPage : SettingsPageAbstract,
|
||||
if (settingsHeader == null) return;
|
||||
|
||||
settingsHeader.Title = Translator.MenuSettings;
|
||||
UpdateWindowTitle();
|
||||
}
|
||||
|
||||
protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
|
||||
@@ -105,6 +108,7 @@ public sealed partial class SettingsPage : SettingsPageAbstract,
|
||||
PageHistory.ForEach(a => a.IsActive = false);
|
||||
|
||||
PageHistory.Add(new BreadcrumbNavigationItemViewModel(message, true));
|
||||
UpdateWindowTitle();
|
||||
}
|
||||
|
||||
private void SettingsFrameNavigated(object sender, NavigationEventArgs e)
|
||||
@@ -136,6 +140,7 @@ public sealed partial class SettingsPage : SettingsPageAbstract,
|
||||
|
||||
// Update back button visibility after navigation
|
||||
ViewModel.StatePersistenceService.IsSettingsNavigating = SettingsFrame.CanGoBack;
|
||||
UpdateWindowTitle();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,4 +159,12 @@ public sealed partial class SettingsPage : SettingsPageAbstract,
|
||||
{
|
||||
GoBackFrame(message.SlideEffect);
|
||||
}
|
||||
|
||||
private void UpdateWindowTitle()
|
||||
{
|
||||
var activeTitle = PageHistory.LastOrDefault()?.Title;
|
||||
ViewModel.StatePersistenceService.CoreWindowTitle = string.IsNullOrWhiteSpace(activeTitle)
|
||||
? Translator.MenuSettings
|
||||
: activeTitle;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user