Viewbox.Stretch Egenskap

Definition

Hämtar eller anger ViewboxStretch läget, vilket avgör hur innehållet passar in i det tillgängliga utrymmet.

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

Egenskapsvärde

En Stretch som avgör hur innehållet passar i det tillgängliga utrymmet. Standardvärdet är Uniform.

Exempel

I följande exempel visas hur du skapar en instans av Viewbox och sedan anger Stretch egenskapen med hjälp av kod.


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

Kommentarer

Information om beroendeegenskap

Objekt Value
Identifierarfält StretchProperty
Metadataegenskaper inställda på true AffectsMeasure

Gäller för

Se även