Share via


Viewbox.Stretch Eigenschaft

Definition

Ruft den Modus ViewboxStretch ab oder legt diesen fest, der bestimmt, wie Inhalt in den verfügbaren Platz passt.

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

Eigenschaftswert

Stretch

Ein Stretch, der bestimmt, wie Inhalt in den verfügbaren Platz passt. Der Standardwert ist Uniform.

Beispiele

Das folgende Beispiel zeigt, wie Sie eine Instanz von und dann mithilfe von Viewbox Code erstellen und die Stretch Eigenschaft festlegen.


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

Hinweise

Informationen zur Abhängigkeitseigenschaft

Bezeichnerfeld StretchProperty
Metadateneigenschaften auf true festgelegt AffectsMeasure

Gilt für

Siehe auch