Frame.NavigationService Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the NavigationService that is used by this Frame to provide navigation services.
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
Property Value
A Frame object that represents the NavigationService used by this Frame, if one is available. Otherwise, null
is returned.
Remarks
Frame uses NavigationService to support navigation for hosted content. NavigationService is useful for code that hosts a Frame to get a reference to the NavigationService. Content that is hosted by a Frame, such as Page, should use GetNavigationService or NavigationService to get a reference to the NavigationService.
Note
NavigationService does not return a reference to the same NavigationService as calling GetNavigationService and passing Frame does. The former returns the NavigationService that is owned by the Frame while the latter returns the NavigationService for the navigation host that navigated to the content in which the Frame is hosted. The following code demonstrates the differences.
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)
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기