Viewbox.StretchDirection Propiedad

Definición

Obtiene o establece la propiedad StretchDirection, que determina cómo se aplica la escala al contenido de una clase 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

Valor de propiedad

StretchDirection que determina cómo se aplica la escala al contenido de una clase Viewbox. De manera predeterminada, es Both.

Ejemplos

En el ejemplo siguiente se muestra cómo crear una instancia de Viewbox y, a continuación, establecer la StretchDirection propiedad mediante código.


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

Comentarios

Esta propiedad determina las restricciones de escalado que se aplican al contenido de .Viewbox Por ejemplo, use esta propiedad para evitar que el contenido de un Viewbox objeto sea menor o mayor que su tamaño original.

Información sobre propiedades de dependencia

Campo identificador StretchDirectionProperty
Propiedades de metadatos establecidas en true AffectsMeasure

Se aplica a

Consulte también