Viewbox.StretchDirection プロパティ

定義

Viewbox のコンテンツにスケーリングを適用する方法を決定する StretchDirection を取得または設定します。

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

プロパティ値

Viewbox のコンテンツにスケーリングを適用する方法を決定する StretchDirection。 既定値は、Both です。

次の例では、 の Viewbox インスタンスを作成し、コードを使用して プロパティを設定する StretchDirection 方法を示します。


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

注釈

このプロパティは、 の内容に適用されるスケーリング制限を Viewbox決定します。 たとえば、このプロパティを使用して、 の内容が元の Viewbox サイズより小さいか大きくなるようにします。

依存プロパティ情報

識別子フィールド StretchDirectionProperty
に設定されたメタデータ プロパティ true AffectsMeasure

適用対象

こちらもご覧ください