Langue

Frame.NavigationService Propriété

Définition

Obtient l’élément NavigationService utilisé par ce Frame paramètre pour fournir des services de navigation.

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

Valeur de propriété

Objet Frame qui représente l’objet NavigationService utilisé par ce Frameparamètre, s’il est disponible. Sinon, null est retournée.

Remarques

Frame utilise NavigationService pour prendre en charge la navigation pour le contenu hébergé. NavigationService est utile pour le code qui héberge un Frame pour obtenir une référence au NavigationService. Le contenu hébergé par un Frame, tel que Page, doit utiliser GetNavigationService ou NavigationService obtenir une référence au NavigationService.

Note

NavigationService ne retourne pas de référence à la même NavigationService chose que l’appel GetNavigationService et le passage Frame . L’ancien retourne celui NavigationService qui Frame appartient au moment où celui-ci retourne l’hôte NavigationService de navigation qui a accédé au contenu dans lequel il Frame est hébergé. Le code suivant illustre les différences.

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)

S’applique à