File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222 <TitleBar
2323 x : Name =" AppTitleBar"
2424 x : Uid =" AppTitleBar"
25- BackRequested =" AppTitleBar_BackRequested" >
25+ BackRequested =" TitleBar_BackRequested"
26+ IsBackButtonVisible =" {x:Bind RootFrame.CanGoBack, Mode=OneWay}" >
2627 <TitleBar .IconSource>
2728 <ImageIconSource ImageSource =" Assets/AppIcon.ico" />
2829 </TitleBar .IconSource>
3334 MainPage.xaml rather than here so you can use Page features such as
3435 navigation events and the Loaded lifecycle.
3536 -->
36- <Frame
37- x : Name =" RootFrame"
38- Grid.Row=" 1"
39- Navigated =" RootFrame_Navigated" />
37+ <Frame x : Name =" RootFrame" Grid.Row=" 1" />
4038 </Grid >
4139</windowex : WindowEx >
Original file line number Diff line number Diff line change @@ -45,16 +45,8 @@ public MainWindow()
4545 RootFrame . Navigate ( typeof ( MainPage ) ) ;
4646 }
4747
48- private void AppTitleBar_BackRequested ( TitleBar sender , object args )
48+ private void TitleBar_BackRequested ( TitleBar sender , object args )
4949 {
50- if ( RootFrame . CanGoBack )
51- {
52- RootFrame . GoBack ( ) ;
53- }
54- }
55-
56- private void RootFrame_Navigated ( object sender , NavigationEventArgs e )
57- {
58- AppTitleBar . IsBackButtonVisible = e . SourcePageType != typeof ( MainPage ) ;
50+ RootFrame . GoBack ( ) ;
5951 }
6052}
You can’t perform that action at this time.
0 commit comments