Assembly: PresentationFramework (in PresentationFramework.dll)
public static NavigationService GetNavigationService( DependencyObject dependencyObject )
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 null 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 .
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2