NavigationWindow.Source 属性

定义

获取或设置当前内容的统一资源标识符 (URI),或当前正在导航到的新内容的 URI。Gets or sets the uniform resource identifier (URI) of the current content, or the URI of new content that is currently being navigated to.

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。The URI for the current content, or the content that is currently being navigated to.

示例

下面的示例演示如何通过设置 Source 属性导航到统一资源标识符(URI)。The following example shows how to navigate to a uniform resource identifier (URI) by setting the Source property.

// 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.SourceSee NavigationService.Source.

备注

统一资源标识符(Uri)可以是相对的,也可以是绝对的。Uniform resource identifiers (URIs) can be either relative or absolute. 有关详细信息,请参阅 WPF 中的 Pack URIFor more information, see Pack URIs in WPF.

依赖项属性信息Dependency Property Information

标识符字段Identifier field Source
元数据属性设置为 trueMetadata properties set to true Journal

适用于