Exemple #1
0
#pragma warning restore

        private Frame CreateFrameAndNavigate(string arg)
        {
            if (!(Window.Current.Content is Frame rootFrame))
            {
                rootFrame = new Frame
                {
                    Background = App.Current.Resources["MyerSplashDarkColorBrush"] as SolidColorBrush
                };
                Window.Current.Content = rootFrame;
            }

            rootFrame.Navigate(typeof(MainPage), arg);
            Window.Current.Activate();

            var view = ApplicationView.GetForCurrentView();

            if (DeviceUtil.IsXbox)
            {
                ApplicationView.GetForCurrentView().SetDesiredBoundsMode(ApplicationViewBoundsMode.UseCoreWindow);

                if (view.TryEnterFullScreenMode())
                {
                    ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.FullScreen;
                }
            }
            else
            {
                view.ExitFullScreenMode();
                ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.Auto;
            }

            TitleBarHelper.SetUpDarkTitleBar();

            SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
            SystemNavigationManager.GetForCurrentView().BackRequested -= App_BackRequested;
            SystemNavigationManager.GetForCurrentView().BackRequested += App_BackRequested;

            return(rootFrame);
        }
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     base.OnNavigatedTo(e);
     TitleBarHelper.SetUpDarkTitleBar();
 }