Frame.NavigationService 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
NavigationService获取用于Frame提供导航服务的项。
public:
property System::Windows::Navigation::NavigationService ^ NavigationService { System::Windows::Navigation::NavigationService ^ get(); };
public System.Windows.Navigation.NavigationService NavigationService { get; }
member this.NavigationService : System.Windows.Navigation.NavigationService
Public ReadOnly Property NavigationService As NavigationService
属性值
一个 Frame 对象,表示 NavigationService 此 Frame对象(如果可用)。 否则将返回 null。
注解
Frame 用于 NavigationService 支持托管内容的导航。
注释
NavigationService不返回对调用NavigationService和传递GetNavigationService相同的Frame引用。 前者返回 NavigationService 所拥有 Frame 的,而后者返回 NavigationService 导航到托管内容的 Frame 导航主机。 以下代码演示了差异。
using System.Windows.Controls;
using System.Windows.Navigation;
Imports System.Windows.Controls
Imports System.Windows.Navigation
// Get the NavigationService owned by the Frame
NavigationService frameNS = this.frame.NavigationService;
// Get the NavigationService for the navigation host that navigated
// to the content in which the Frame is hosted
NavigationService navigationHostNS = NavigationService.GetNavigationService(this.frame);
' Get the NavigationService owned by the Frame
Dim frameNS As NavigationService = Me.frame.NavigationService
' Get the NavigationService for the navigation host that navigated
' to the content in which the Frame is hosted
Dim navigationHostNS As NavigationService = NavigationService.GetNavigationService(Me.frame)