通过


NavigationWindow.Source 属性

定义

获取或设置当前内容的统一资源标识符(URI),或当前导航到的新内容的 URI。

public:
 property Uri ^ Source { Uri ^ get(); void set(Uri ^ value); };
public Uri Source { get; set; }
member this.Source : Uri with get, set
Public Property Source As Uri

属性值

Uri

当前内容的 URI 或当前导航到的内容。

示例

以下示例演示如何通过设置 Source 属性导航到统一资源标识符(URI)。

// Navigate to URI using the Source property
this.Source = new Uri("HomePage.xaml", UriKind.Relative);
' Navigate to URI using the Source property
Me.Source = New Uri("HomePage.xaml", UriKind.Relative)

注解

请参阅 NavigationService.Source

注释

统一资源标识符(URI)可以是相对标识符或绝对标识符。 有关详细信息,请参阅 WPF 中的包 URI

Dependency 属性信息

物品 价值
标识符字段 Source
元数据属性设置为 true Journal

适用于