Frame.NavigationService Proprietà

Definizione

Ottiene l'oggetto NavigationService utilizzato da questo Frame oggetto per fornire servizi di spostamento.

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 l'oggetto NavigationService utilizzato da , Framese disponibile. In caso contrario, viene restituito null.

Commenti

Frame usa per supportare la NavigationService 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 per ottenere un riferimento all'oggetto NavigationService.

Note

NavigationService non restituisce un riferimento allo stesso NavigationService modo della chiamata GetNavigationService e del Frame passaggio. Il primo restituisce l'oggetto NavigationService di proprietà di Frame mentre quest'ultimo restituisce per NavigationService l'host di spostamento che ha eseguito lo spostamento al contenuto in cui è ospitato l'oggetto 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