1313using Microsoft . UI . Xaml . Media ;
1414using Microsoft . UI . Xaml . Navigation ;
1515using UniGetUI . Core . Tools ;
16+ using Microsoft . UI . Xaml . Media . Animation ;
1617
1718// To learn more about WinUI, the WinUI project structure,
1819// and more about our project templates, see: http://aka.ms/winui-project-info.
@@ -27,10 +28,14 @@ public sealed partial class SettingsBasePage : Page
2728 public SettingsBasePage ( )
2829 {
2930 this . InitializeComponent ( ) ;
30- BackButton . Click += ( _ , _ ) => MainNavigationFrame . NavigateToType ( typeof ( SettingsHomepage ) , null , new ( ) ) ;
31+ BackButton . Click += ( _ , _ ) =>
32+ {
33+ if ( MainNavigationFrame . CanGoBack ) MainNavigationFrame . GoBack ( ) ;
34+ else MainNavigationFrame . Navigate ( typeof ( SettingsHomepage ) , null , new DrillInNavigationTransitionInfo ( ) ) ;
35+ } ;
3136 MainNavigationFrame . Navigated += MainNavigationFrame_Navigated ;
3237 MainNavigationFrame . Navigating += MainNavigationFrame_Navigating ;
33- MainNavigationFrame . NavigateToType ( typeof ( SettingsHomepage ) , null , new ( ) ) ;
38+ MainNavigationFrame . Navigate ( typeof ( SettingsHomepage ) , null , new DrillInNavigationTransitionInfo ( ) ) ;
3439
3540 RestartRequired . Message = CoreTools . Translate ( "Restart WingetUI to fully apply changes" ) ;
3641 var RestartButton = new Button
@@ -71,7 +76,7 @@ private void Page_RestartRequired(object? sender, EventArgs e)
7176
7277 private void Page_NavigationRequested ( object ? sender , Type e )
7378 {
74- MainNavigationFrame . NavigateToType ( e , null , new ( ) ) ;
79+ MainNavigationFrame . Navigate ( e , null , new DrillInNavigationTransitionInfo ( ) ) ;
7580 }
7681 }
7782}
0 commit comments