Viewbox.StretchDirection Egenskap
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Hämtar eller anger StretchDirection, som avgör hur skalning tillämpas på innehållet i en 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
Egenskapsvärde
En StretchDirection som avgör hur skalning tillämpas på innehållet i en Viewbox. Standardvärdet är Both.
Exempel
I följande exempel visas hur du skapar en instans av Viewbox och sedan anger StretchDirection 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
Den här egenskapen bestämmer skalningsbegränsningarna som gäller för innehållet i en Viewbox. Använd till exempel den här egenskapen för att förhindra att innehållet i en Viewbox blir mindre eller större än dess ursprungliga storlek.
Information om beroendeegenskap
| Objekt | Value |
|---|---|
| Identifierarfält | StretchDirectionProperty |
Metadataegenskaper inställda på true |
AffectsMeasure |