Frame.NavigationService Propriedade

Definição

Obtém o NavigationService que é usado por isto Frame para fornecer serviços de navegação.

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 Propriedade

Um Frame objeto que representa o NavigationService usado por este Frame, se estiver disponível. Caso contrário, null é devolvido.

Observações

Frame Utiliza-se NavigationService para suportar a navegação de conteúdos alojados. NavigationService é útil para código que hospeda a Frame para obter uma referência ao NavigationService. Conteúdo alojado por um Frame, como Page, deve usar GetNavigationService ou NavigationService para obter uma referência ao NavigationService.

Note

NavigationService não retorna uma referência ao mesmo NavigationService que chamar GetNavigationService e passar Frame . O primeiro devolve o NavigationService que pertence ao Frame enquanto o segundo devolve o NavigationService para o anfitrião de navegação que navegou até ao conteúdo onde o Frame está alojado. O código seguinte demonstra as diferenças.

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)

Aplica-se a