コード例 #1
0
ファイル: UnitTestApp.xaml.cs プロジェクト: TonyZZX/Touch.UWP
        /// <summary>
        ///     Invoked when the application is launched normally by the end user.  Other entry points
        ///     will be used such as when the application is launched to open a specific file.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
#if DEBUG
            if (Debugger.IsAttached)
            {
                DebugSettings.EnableFrameRateCounter = true;
            }
#endif

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            // ReSharper disable once RedundantAssignment
            if (!(Window.Current.Content is Frame rootFrame))
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();

                rootFrame.NavigationFailed += OnNavigationFailed;

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: Load state from previously suspended application
                }

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            UnitTestClient.CreateDefaultUI();

            // Ensure the current window is active
            Window.Current.Activate();

            UnitTestClient.Run(e.Arguments);
        }
コード例 #2
0
        /// <summary>
        /// Invoked when the application is launched normally by the end user.  Other entry points
        /// will be used such as when the application is launched to open a specific file.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
#if DEBUG
            if (Debugger.IsAttached)
            {
                DebugSettings.EnableFrameRateCounter = true;
            }
#endif

            var rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();

                rootFrame.NavigationFailed += OnNavigationFailed;

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            UnitTestClient.CreateDefaultUI();

            // Ensure the current window is active
            Window.Current.Activate();

            UnitTestClient.Run(e.Arguments);
        }
コード例 #3
0
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
            if (Window.Current.Content is not Frame rootFrame)
            {
                rootFrame = new Frame();
                rootFrame.NavigationFailed += OnNavigationFailed;
                Window.Current.Content      = rootFrame;
            }

            UnitTestClient.Run(e.Arguments);
        }
コード例 #4
0
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
            if (!(Window.Current.Content is Frame rootFrame))
            {
                rootFrame = new Frame();
                rootFrame.NavigationFailed += (sender, e) =>
                                              throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
                Window.Current.Content = rootFrame;
            }

            DebugSettings.EnableFrameRateCounter = Debugger.IsAttached;
            UnitTestClient.CreateDefaultUI();
            Window.Current.Activate();
            UnitTestClient.Run(e.Arguments);
        }
コード例 #5
0
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
            var rootFrame = Window.Current.Content as Frame;

            if (rootFrame == null)
            {
                rootFrame = new Frame();
                rootFrame.NavigationFailed += OnNavigationFailed;
                Window.Current.Content      = rootFrame;
            }

            UnitTestClient.CreateDefaultUI();

            Window.Current.Activate();

            UnitTestClient.Run(e.Arguments);
        }
コード例 #6
0
 /// <summary>
 /// Invoked when the application is launched normally by the end user. Other entry points will be used when the application is launched to open a
 /// specific file, to display search results, and so forth.
 /// </summary>
 /// <param name="event">Details about the launch request and process.</param>
 protected override void OnLaunched(LaunchActivatedEventArgs @event)
 {
     UnitTestClient.CreateDefaultUI();
     base.OnLaunched(@event);
     UnitTestClient.Run(@event.Arguments);
 }