StretchDirection 列挙型

定義

スケーリングがコンテンツにどのように適用されるかについて説明し、スケーリングを名前付き軸の種類に制限します。

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

フィールド

名前 説明
UpOnly 0

コンテンツは、親よりも小さい場合にのみ上向きにスケーリングされます。 コンテンツが大きい場合、スケールダウンは実行されません。

DownOnly 1

コンテンツは、親よりも大きい場合にのみ下方向に拡大縮小されます。 コンテンツが小さい場合、スケールアップは実行されません。

Both 2

コンテンツは、 Stretch モードに従って親に合わせて拡張されます。

次の例では、コードを使用して 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

適用対象

こちらもご覧ください