Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/257.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# UWP根帧与页帧_C#_Uwp_Uwp Xaml - Fatal编程技术网

C# UWP根帧与页帧

C# UWP根帧与页帧,c#,uwp,uwp-xaml,C#,Uwp,Uwp Xaml,下面是典型的App.xaml.cs代码 protected override void OnLaunched(LaunchActivatedEventArgs e) { #if DEBUG if (System.Diagnostics.Debugger.IsAttached) { //this.DebugSettings.EnableFrameRateCounter = true; } #endif

下面是典型的App.xaml.cs代码

protected override void OnLaunched(LaunchActivatedEventArgs e)
    {
#if DEBUG
        if (System.Diagnostics.Debugger.IsAttached)
        {
            //this.DebugSettings.EnableFrameRateCounter = true;
        }
#endif
        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;
            rootFrame.Navigated += OnNavigated;

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

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

            // Register a handler for BackRequested events and set the
            // visibility of the Back button
            SystemNavigationManager.GetForCurrentView().BackRequested += OnBackRequested;

            SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility =
                rootFrame.CanGoBack ?
                AppViewBackButtonVisibility.Visible :
                AppViewBackButtonVisibility.Collapsed;
        }

        if (e.PrelaunchActivated == false)
        {
            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(SignInPage), e.Arguments);
            }
            // Ensure the current window is active
            Window.Current.Activate();
        }
    }

rootFrame.Navigate(typeof(signingpage),例如Arguments)时,则创建
SignInPage
。在
SignInPage.xaml.cs
中,可能有如下代码:
this.Frame.Navigate(typeof(FramePage))。来自
此.Frame.
框架是否与
根框架
相同?如果是,那么
页面
类在何时何地从
App.xaml.cs
获得根框架的分配?

是的,这是相同的
框架
对象,因为
页面
引用了控制其内容的框架。换句话说,
框架
,用于导航页面

获取页面内容的控制框架

资料来源:


此属性在导航时自动设置,并首先在
OnNavigatedTo
方法中的
页面
对象中可用。

是的,这与
框架
对象相同,因为
页面
引用了控制其内容的框架。换句话说,
框架
,用于导航页面

获取页面内容的控制框架

资料来源:

此属性在导航时自动设置,并首先在
OnNavigatedTo
方法中的
页面
对象中可用