Share via


Viewbox.StretchDirection Proprietà

Definizione

Ottiene o imposta l'oggetto StretchDirection, che determina il modo in cui viene applicato il ridimensionamento al contenuto di un oggetto 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

Valore della proprietà

Oggetto StretchDirection che determina il modo in cui viene applicato il ridimensionamento al contenuto di un oggetto Viewbox. Il valore predefinito è Both.

Esempio

Nell'esempio seguente viene illustrato come creare un'istanza di Viewbox e quindi impostare la StretchDirection proprietà usando il 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

Questa proprietà determina le restrizioni di ridimensionamento che si applicano al contenuto di un Viewboxoggetto . Ad esempio, usare questa proprietà per impedire che il contenuto di un oggetto Viewbox sia minore o maggiore della dimensione originale.

Informazioni proprietà di dipendenza

Campo Identificatore StretchDirectionProperty
Proprietà dei metadati impostate su true AffectsMeasure

Si applica a

Vedi anche