예제 #1
0
파일: App.xaml.cs 프로젝트: rmccomb/UWPRef
        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);
        }
예제 #2
0
파일: App.xaml.cs 프로젝트: rmccomb/UWPRef
        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);
        }
예제 #3
0
        public NavigationRootPage()
        {
            this.InitializeComponent();
            //_navHelper = new RootFrameNavigationHelper(rootFrame);
            Current   = this;
            RootFrame = this.rootFrame;

            SystemNavigationManager.GetForCurrentView().BackRequested += SystemNavigationManager_BackRequested;
            SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;
        }