Share via


Frame.NavigationService Özellik

Tanım

NavigationService Gezinti hizmetleri sağlamak için bu Frame tarafından kullanılan öğesini alır.

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

Özellik Değeri

Frame Varsa, bu Frametarafından kullanılan öğesini temsil eden NavigationService bir nesne. null Aksi takdirde döndürülür.

Açıklamalar

Frame barındırılan içerikte gezinmeyi desteklemek için kullanır NavigationService . NavigationService , öğesine başvuru almak için bir Frame barındıran kod için NavigationServiceyararlıdır. gibi bir Frametarafından barındırılan içerik, öğesine başvuru NavigationServicealmak için veya NavigationService kullanmalıdırGetNavigationService.Page

Not

NavigationServiceçağırma GetNavigationService ve geçirme Frame işlemiyle aynı NavigationService başvuruyu döndürmez. önceki, öğesinin sahip Frame olduğu değerini döndürürkenNavigationService, ikincisinde barındırıldığı Frame içeriğe gidilen gezinti konağı için değerini döndürürNavigationService. Aşağıdaki kod farkları gösterir.

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)

Şunlara uygulanır