Viewbox.Stretch Viewbox.Stretch Viewbox.Stretch Viewbox.Stretch Property


コンテンツを使用可能な領域に収める方法を決定する ViewboxStretch モードを取得または設定します。Gets or sets the ViewboxStretch mode, which determines how content fits into the available space.

 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


コンテンツを使用可能な領域に収める方法を決定する StretchA Stretch that determines how content fits in the available space. 既定値は、Uniform です。The default is Uniform.

次の例は、のインスタンスを作成する方法を示しています。Viewboxし、設定、Stretchコードを使用してプロパティ。The following example shows how to create an instance of Viewbox and then set the Stretch property by using code.

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


依存プロパティ情報Dependency Property Information

識別子フィールドです。Identifier field StretchProperty
メタデータのプロパティを設定するには trueMetadata properties set to true AffectsMeasure