Viewbox.Stretch Propriedade

Definição

Obtém ou define o modo ViewboxStretch, que determina como o conteúdo se ajusta ao espaço disponível.

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

Valor da propriedade

Stretch

Um Stretch que determina como o conteúdo se ajusta ao espaço disponível. O padrão é Uniform.

Exemplos

O exemplo a seguir mostra como criar uma instância Viewbox e, em seguida, definir a Stretch propriedade usando 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

Comentários

Informações da propriedade de dependência

Campo identificador StretchProperty
Propriedades de metadados definidas como true AffectsMeasure

Aplica-se a

Confira também