Bagikan melalui


FontFamily.Source Properti

Definisi

Mendapatkan nama keluarga font yang digunakan untuk membuat FontFamily objek.

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

Nilai Properti

Nama FontFamily keluarga font objek.

Contoh

Contoh berikut menunjukkan hasil pengambilan BaseUri nilai properti dan Source dari FontFamily objek.

// 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

Keterangan

Untuk mengembalikan nilai FontFamily pengidentifikasi sumber daya seragam dasar (URI) objek, gunakan BaseUri.

FontFamily Jika objek dibuat tanpa menentukan nama keluarga font, nilai yang dikembalikan adalah Empty.

Berlaku untuk