Share via


Viewbox.Stretch Proprietà

Definizione

Ottiene o imposta la modalità Stretch di Viewbox, che determina come il contenuto viene adattato allo spazio disponibile.

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

Valore della proprietà

Stretch

Stretch che determina come il contenuto viene adattato allo spazio disponibile. Il valore predefinito è Uniform.

Esempio

Nell'esempio seguente viene illustrato come creare un'istanza di Viewbox e quindi impostare la proprietà usando il Stretch codice .


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

Commenti

Informazioni proprietà di dipendenza

Campo Identificatore StretchProperty
Proprietà dei metadati impostate su true AffectsMeasure

Si applica a

Vedi anche