Assembly: PresentationFramework (in PresentationFramework.dll)
'Declaration Public Shared Function GetNavigationService ( _ dependencyObject As DependencyObject _ ) As NavigationService
A navigator has a NavigationService that handles content navigation. WPF has two navigators: NavigationWindow and Frame. To process navigation requests and manage navigation lifetime, a navigator uses the WPF navigation service, which is implemented as the NavigationService class. Content that is hosted by a navigator can get a reference to the navigator's NavigationService by calling the method.
returns Nothing when the dependencyObject:
Is a NavigationWindow.
Is a Frame that:
Is not part of content that is hosted by a navigator.
WPF offers two shortcuts for acquiring a reference to the NavigationService:
The following example shows how a UserControl can retrieve a navigation service by calling .
Private Sub getNavigationServiceButton_Click(ByVal sender As Object, ByVal e As RoutedEventArgs) ' Retrieve first navigation service up the content tree Dim svc As NavigationService = NavigationService.GetNavigationService(Me.getNavigationServiceButton) If svc IsNot Nothing Then ' Use navigation service ... End If End Sub
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.