diff --git a/StabilityMatrix.Avalonia/Views/SettingsPage.axaml.cs b/StabilityMatrix.Avalonia/Views/SettingsPage.axaml.cs index aa34012d..3bbac21d 100644 --- a/StabilityMatrix.Avalonia/Views/SettingsPage.axaml.cs +++ b/StabilityMatrix.Avalonia/Views/SettingsPage.axaml.cs @@ -23,6 +23,8 @@ public partial class SettingsPage : UserControlBase { private readonly INavigationService settingsNavigationService; + private bool hasLoaded; + private SettingsViewModel ViewModel => (SettingsViewModel)DataContext!; [DesignOnly(true)] @@ -47,16 +49,19 @@ public partial class SettingsPage : UserControlBase { base.OnLoaded(e); - Dispatcher.UIThread.Post( - () => - settingsNavigationService.NavigateTo( - ViewModel.SubPages[0], - new BetterSlideNavigationTransition - { - Effect = SlideNavigationTransitionEffect.FromBottom - } - ) - ); + if (!hasLoaded) + { + // Initial load, navigate to first page + Dispatcher.UIThread.Post( + () => + settingsNavigationService.NavigateTo( + ViewModel.SubPages[0], + new SuppressNavigationTransitionInfo() + ) + ); + + hasLoaded = true; + } } private void NavigationService_OnTypedNavigation(object? sender, TypedNavigationEventArgs e) @@ -81,7 +86,8 @@ public partial class SettingsPage : UserControlBase BreadcrumbBarItemClickedEventArgs args ) { - if (args.Item is not PageViewModelBase viewModel) + // Skip if already on same page + if (args.Item is not PageViewModelBase viewModel || viewModel == ViewModel.CurrentPage) { return; }