Frame.NavigationService Propiedad

Definición

Obtiene el NavigationService que Frame utiliza para proporcionar servicios de navegación.

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

Valor de propiedad

Un objeto Frame que representa el NavigationService utilizado por este Frame, si hay alguno disponible. En caso contrario, devuelve null.

Comentarios

Frame usa NavigationService para admitir la navegación para el contenido hospedado. NavigationServicees útil para el código que hospeda un Frame para obtener una referencia a .NavigationService El contenido hospedado por , Framecomo Page, debe usar GetNavigationService o NavigationService para obtener una referencia a NavigationService.

Nota

NavigationService no devuelve una referencia a la misma NavigationService que la llamada GetNavigationService y el paso Frame . El anterior devuelve el NavigationService que es propiedad de Frame mientras que el último devuelve el NavigationService para el host de navegación que ha navegado al contenido en el Frame que está hospedado. En el código siguiente se muestran las diferencias.

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)

Se aplica a