Exemple #1
0
        void LoadFrame(IActivatedEventArgs args, object arguments)
        {
            Frame rootFrame = Window.Current.Content as Frame;

            if (args.Kind != ActivationKind.File)
            {
                CoreWindowLogic.Replay();
            }
            else
            {
                CoreWindowLogic.Replay(true);
            }
            // Do not repeat app initialization when the Window already has content
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context
                rootFrame = new Frame();

                if (args.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: Load state from previously suspended application
                }
                rootFrame.NavigationFailed += OnNavigationFailed;
                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }
            if (rootFrame.Content == null)
            {
                // When the navigation stack isn't restored navigate to the first page,
                // configuring the new page by passing required information as a navigation
                // parameter
                rootFrame.Navigate(typeof(Shell), arguments);
            }

            // CoreWindowLogic logic = new CoreWindowLogic();
            var view = ApplicationView.GetForCurrentView();

            if (RequestedTheme == ApplicationTheme.Dark)
            {
                view.TitleBar.BackgroundColor       = Color.FromArgb(20, 20, 20, 1);
                view.TitleBar.ButtonBackgroundColor = Color.FromArgb(20, 20, 20, 1);
            }
            if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
            {
                //view.SetDesiredBoundsMode(ApplicationViewBoundsMode.UseCoreWindow);
                var statusBar = StatusBar.GetForCurrentView();
                statusBar.BackgroundColor   = RequestedTheme == ApplicationTheme.Light ? (App.Current.Resources["PhoneAccentBrush"] as SolidColorBrush).Color : Color.FromArgb(20, 20, 20, 1);
                statusBar.BackgroundOpacity = 1;
                statusBar.ForegroundColor   = Colors.White;
            }

            Window.Current.Activate();
        }
Exemple #2
0
        void LoadFrame(IActivatedEventArgs args, object arguments)
        {
            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context
                rootFrame = new Frame();

                rootFrame.NavigationFailed += OnNavigationFailed;
                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }
            if (rootFrame.Content == null)
            {
                // When the navigation stack isn't restored navigate to the first page,
                // configuring the new page by passing required information as a navigation
                // parameter
                rootFrame.Navigate(typeof(Shell), arguments);
            }

            var view = ApplicationView.GetForCurrentView();

            if (RequestedTheme == ApplicationTheme.Dark)
            {
                view.TitleBar.BackgroundColor       = Color.FromArgb(20, 20, 20, 1);
                view.TitleBar.ButtonBackgroundColor = Color.FromArgb(20, 20, 20, 1);
            }

            Window.Current.Activate();

            if (args.Kind != ActivationKind.File)
            {
                CoreWindowLogic.Replay();
            }
            else
            {
                CoreWindowLogic.Replay(true);
            }
        }