Frame.NavigationService Proprietà

Definizione

Ottiene il NavigationService utilizzato da Frame per fornire servizi di navigazione.

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

Valore della proprietà

Oggetto Frame che rappresenta il NavigationService utilizzato da Frame, se disponibile. In caso contrario, viene restituito null.

Commenti

FrameNavigationService usa per supportare la navigazione per il contenuto ospitato. NavigationService è utile per il codice che ospita un Frame oggetto per ottenere un riferimento a NavigationService. Il contenuto ospitato da un Frameoggetto , ad esempio Page, deve usare GetNavigationService o NavigationService ottenere un riferimento a NavigationService.

Nota

NavigationServicenon restituisce Frame un riferimento allo stesso NavigationService modo di chiamare GetNavigationService e passare. Il precedente restituisce l'oggetto NavigationService di proprietà di Frame mentre quest'ultimo restituisce l'oggetto NavigationService per l'host di spostamento che ha spostato sul contenuto in cui è ospitato.Frame Il codice seguente illustra le differenze.

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)

Si applica a