FontFamily.Source 属性

定义

获取用于构造 FontFamily 对象的字体系列名称。

public:
 property System::String ^ Source { System::String ^ get(); };
public string Source { get; }
member this.Source : string
Public ReadOnly Property Source As String

属性值

FontFamily 对象的字体系列名称。

示例

以下示例显示从 FontFamily 对象检索 BaseUriSource 属性值的结果。

// Create a new FontFamily object, using a base URI reference and a relative URI reference.
myTextBlock.FontFamily = new FontFamily(new Uri("pack://application:,,,/resources/"), "./#Pericles Light");

// The value of baseUri.AbsoluteUri is "pack://application:,,,/resources/".
Uri baseUri = myTextBlock.FontFamily.BaseUri;

// The value of source is "./#Pericles Light".
string source = myTextBlock.FontFamily.Source;
' Create a new FontFamily object, using a base URI reference and a relative URI reference.
myTextBlock.FontFamily = New FontFamily(New Uri("pack://application:,,,/resources/"), "./#Pericles Light")

' The value of baseUri.AbsoluteUri is "pack://application:,,,/resources/".
Dim baseUri As Uri = myTextBlock.FontFamily.BaseUri

' The value of source is "./#Pericles Light".
Dim source As String = myTextBlock.FontFamily.Source

注解

若要返回对象的基本统一 FontFamily 资源标识符 (URI) 值,请使用 BaseUri

FontFamily如果对象是在未指定字体系列名称的情况下创建的,则返回值为 Empty

适用于