private Frame GetRootFrame() { Frame rootFrame; NavigationRootPage rootPage = Window.Current.Content as NavigationRootPage; if (rootPage == null) { rootPage = new NavigationRootPage(); rootFrame = (Frame)rootPage.FindName("rootFrame"); if (rootFrame == null) { throw new Exception("Root frame not found"); } SuspensionManager.RegisterFrame(rootFrame, "AppFrame"); rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0]; rootFrame.NavigationFailed += OnNavigationFailed; Window.Current.Content = rootPage; } else { rootFrame = (Frame)rootPage.FindName("rootFrame"); rootPage.Extend = this.Extend; rootPage.EnsureAppTitle(); } return(rootFrame); }
void UpdateAppTitle() { var full = (Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().IsFullScreenMode); var left = 12 + (full ? 0 : Windows.ApplicationModel.Core.CoreApplication.GetCurrentView().TitleBar.SystemOverlayLeftInset); NavigationRootPage rootPage = Window.Current.Content as NavigationRootPage; rootPage.AppTitle.Margin = new Thickness(left, 8, 0, 0); }
public NavigationRootPage() { this.InitializeComponent(); //_navHelper = new RootFrameNavigationHelper(rootFrame); Current = this; RootFrame = this.rootFrame; SystemNavigationManager.GetForCurrentView().BackRequested += SystemNavigationManager_BackRequested; SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible; }