次の方法で共有


AdornerPanel.SetPlacements メソッド

更新 : 2007 年 11 月

指定した要素に Placements 添付プロパティの値を設定します。

名前空間 :  Microsoft.Windows.Design.Interaction
アセンブリ :  Microsoft.Windows.Design.Interaction (Microsoft.Windows.Design.Interaction.dll 内)

構文

'宣言
Public Shared Sub SetPlacements ( _
    adorner As UIElement, _
    value As AdornerPlacementCollection _
)
'使用
Dim adorner As UIElement
Dim value As AdornerPlacementCollection

AdornerPanel.SetPlacements(adorner, value)
public static void SetPlacements(
    UIElement adorner,
    AdornerPlacementCollection value
)
public:
static void SetPlacements(
    UIElement^ adorner, 
    AdornerPlacementCollection^ value
)
public static function SetPlacements(
    adorner : UIElement, 
    value : AdornerPlacementCollection
)

パラメータ

例外

例外 条件
ArgumentNullException

adorner が nullnull 参照 (Visual Basic では Nothing) です。

SetPlacements メソッドを使用して、装飾パネル内の装飾の位置を指定する方法を次のコード例に示します。詳細については、「チュートリアル : デザイン時装飾の作成」を参照してください。

Dim placement As New AdornerPlacementCollection()

' The adorner's width is relative to the content.
' The slider extends the full width of the control it adorns.
placement.SizeRelativeToContentWidth(1.0, 0)

' The adorner's height is the same as the slider's.
placement.SizeRelativeToAdornerDesiredHeight(1.0, 0)

' Position the adorner above the control it adorns.
placement.PositionRelativeToAdornerHeight(-1.0, 0)

' Position the adorner up 5 pixels. This demonstrates 
' that these placement calls are additive. These two calls
' are equivalent to the following single call:
' PositionRelativeToAdornerHeight(-1.0, -5).
placement.PositionRelativeToAdornerHeight(0, -5)

AdornerPanel.SetPlacements(opacitySlider, placement)
AdornerPlacementCollection placement = new AdornerPlacementCollection();

// The adorner's width is relative to the content.
// The slider extends the full width of the control it adorns.
placement.SizeRelativeToContentWidth(1.0, 0);

// The adorner's height is the same as the slider's.
placement.SizeRelativeToAdornerDesiredHeight(1.0, 0);

// Position the adorner above the control it adorns.
placement.PositionRelativeToAdornerHeight(-1.0, 0);

// Position the adorner up 5 pixels. This demonstrates 
// that these placement calls are additive. These two calls
// are equivalent to the following single call:
// PositionRelativeToAdornerHeight(-1.0, -5).
placement.PositionRelativeToAdornerHeight(0, -5);

AdornerPanel.SetPlacements(opacitySlider, placement);

アクセス許可

  • 直前の呼び出し元に対する完全な信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

参照

AdornerPanel クラス

AdornerPanel メンバ

Microsoft.Windows.Design.Interaction 名前空間

その他の技術情報

装飾アーキテクチャ

レイアウト空間と描画空間

機能プロバイダと機能コネクタ