Bagikan melalui


Viewbox.StretchDirection Properti

Definisi

Mendapatkan atau mengatur StretchDirection, yang menentukan bagaimana penskalaan diterapkan ke konten Viewbox.

public:
 property System::Windows::Controls::StretchDirection StretchDirection { System::Windows::Controls::StretchDirection get(); void set(System::Windows::Controls::StretchDirection value); };
public System.Windows.Controls.StretchDirection StretchDirection { get; set; }
member this.StretchDirection : System.Windows.Controls.StretchDirection with get, set
Public Property StretchDirection As StretchDirection

Nilai Properti

StretchDirection Yang menentukan bagaimana penskalaan diterapkan ke konten Viewbox. Defaultnya adalah Both.

Contoh

Contoh berikut menunjukkan cara membuat instans Viewbox lalu mengatur StretchDirection properti dengan menggunakan kode.


// Create a Viewbox and add it to the Canvas
myViewbox = gcnew Viewbox();
myViewbox->StretchDirection = StretchDirection::Both;
myViewbox->Stretch = Stretch::Fill;
myViewbox->MaxWidth = 400;
myViewbox->MaxHeight = 400;

// Create a Viewbox and add it to the Canvas
myViewbox = new Viewbox();
myViewbox.StretchDirection = StretchDirection.Both;
myViewbox.Stretch = Stretch.Fill;
myViewbox.MaxWidth = 400;
myViewbox.MaxHeight = 400;

' Create a ViewBox and add it to the Canvas
Dim myViewbox As New Viewbox()
myViewbox.StretchDirection = StretchDirection.Both
myViewbox.Stretch = Stretch.Fill
myViewbox.MaxWidth = 400
myViewbox.MaxHeight = 400

Keterangan

Properti ini menentukan batasan penskalaan yang berlaku untuk konten Viewbox. Misalnya, gunakan properti ini untuk mencegah konten menjadi Viewbox lebih kecil atau lebih besar dari ukuran aslinya.

Informasi Properti Dependensi

Item Nilai
Bidang pengidentifikasi StretchDirectionProperty
Properti metadata diatur ke true AffectsMeasure

Berlaku untuk

Lihat juga