共用方式為


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

備註

若要傳回物件 (URI) 值的基底統一 FontFamily 資源識別碼,請使用 BaseUri

FontFamily如果建立物件而不指定字型系列名稱,則傳回值為 Empty

適用於