IAdornerPlacement 인터페이스
업데이트: 2007년 11월
AdornerPlacementCollection의 배치 항목을 지정합니다.
네임스페이스: Microsoft.Windows.Design.Interaction
어셈블리: Microsoft.Windows.Design.Interaction(Microsoft.Windows.Design.Interaction.dll)
구문
Public Interface IAdornerPlacement
Dim instance As IAdornerPlacement
public interface IAdornerPlacement
public interface class IAdornerPlacement
public interface IAdornerPlacement
설명
배치 항목은 AdornerPanel에 표시기(Adorner)를 배치하고 크기를 조정할 때 유연성을 제공하는 값 집합을 구성하는 데 사용됩니다.
예제
다음 코드 예제에서는 컨트롤 내에 레일 표시기를 배치하는 방법을 보여 줍니다. 자세한 내용은 연습: 컨트롤 내에 레일 구현을 참조하십시오.
' Place the slider in the adorner panel.
Dim placement As New AdornerPlacementCollection()
AdornerPanel.SetHorizontalStretch(skewSlider, AdornerStretch.Stretch)
AdornerPanel.SetVerticalStretch(skewSlider, AdornerStretch.None)
' Use layout space for the adorner panel.
' If render space were used, the slider would skew along with the button.
panel.CoordinateSpace = AdornerCoordinateSpaces.Layout
' The adorner's width is relative to the content.
' The slider extends half the width of the control it adorns.
placement.SizeRelativeToContentWidth(0.5, 0)
' Center the adorner within the control.
placement.PositionRelativeToAdornerWidth(0.5, 0)
' The adorner's height is the same as the slider's.
placement.SizeRelativeToAdornerDesiredHeight(1.0, 0)
' Position the adorner within the control it adorns.
placement.PositionRelativeToAdornerHeight(1.0, 0)
AdornerPanel.SetPlacements(skewSlider, placement)
// Place the slider in the adorner panel.
AdornerPlacementCollection placement = new AdornerPlacementCollection();
AdornerPanel.SetHorizontalStretch(skewSlider, AdornerStretch.Stretch);
AdornerPanel.SetVerticalStretch(skewSlider, AdornerStretch.None);
// Use layout space for the adorner panel.
// If render space were used, the slider would skew along with the button.
panel.CoordinateSpace = AdornerCoordinateSpaces.Layout;
// The adorner's width is relative to the content.
// The slider extends half the width of the control it adorns.
placement.SizeRelativeToContentWidth(0.5, 0);
// Center the adorner within the control.
placement.PositionRelativeToAdornerWidth(0.5, 0);
// The adorner's height is the same as the slider's.
placement.SizeRelativeToAdornerDesiredHeight(1.0, 0);
// Position the adorner within the control it adorns.
placement.PositionRelativeToAdornerHeight(1.0, 0);
AdornerPanel.SetPlacements(skewSlider, placement);
참고 항목
참조
Microsoft.Windows.Design.Interaction 네임스페이스