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は、Frameへの参照を取得するNavigationServiceをホストするコードに役立ちます。 FrameなどのPageによってホストされるコンテンツは、GetNavigationServiceまたはNavigationServiceを使用してNavigationServiceへの参照を取得する必要があります。
Note
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)