StretchDirection 列挙型

定義

コンテンツにスケーリングがどのように適用されるかを記述し、指定された軸の種類にスケーリングを制限します。

public enum class StretchDirection
public enum StretchDirection
type StretchDirection = 
Public Enum StretchDirection
継承
StretchDirection

フィールド

Both 2

コンテンツは、Stretch モードに基づいて、親に合わせて伸縮します。

DownOnly 1

コンテンツが親よりも大きい場合のみ、縮小方向にスケーリングします。 コンテンツの方が親より小さくても、拡大方向にはスケーリングしません。

UpOnly 0

コンテンツが親よりも小さい場合のみ、拡大方向にスケーリングします。 コンテンツの方が親より大きくても、縮小方向にはスケーリングしません。

次の例は、 のインスタンス 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

適用対象

こちらもご覧ください