다음을 통해 공유


AdornerPanel 클래스

업데이트: 2007년 11월

디자인 타임에 표시기(Adorner)로 사용되는 WPF(Windows Presentation Foundation) 컨트롤의 컨테이너를 제공합니다.

네임스페이스:  Microsoft.Windows.Design.Interaction
어셈블리:  Microsoft.Windows.Design.Interaction(Microsoft.Windows.Design.Interaction.dll)

구문

Public Class AdornerPanel _
    Inherits Panel

Dim instance As AdornerPanel
public class AdornerPanel : Panel
public ref class AdornerPanel : public Panel
public class AdornerPanel extends Panel

설명

AdornerPanel 클래스를 사용하여 디자인 타임 표시기를 저장합니다. 표시기는 다른 UI를 꾸미는 UI(사용자 인터페이스)입니다.

표시기를 나타낼 컨트롤을 Children 컬렉션에 추가합니다.

SetHorizontalStretchSetVerticalStretch 메서드를 호출하여 표시된 컨트롤을 기준으로 표시기 패널의 크기를 조정합니다.

표시기를 배치하고 크기를 조정하려면 AdornerPlacementCollection을 만들고 크기 및 위치 관련 메서드를 호출합니다. SetPlacements 메서드를 사용하여 표시기 패널에 AdornerPlacementCollection을 추가합니다.

설정된 표시기 패널을 AdornerProvider 구현의 Adorners 컬렉션에 추가합니다.

표시기는 Tool 연결된 속성을 통해 도구 명령에 바인딩됩니다. 마우스로 표시기를 가리키면 표시기의 바인딩을 입력 및 명령 라우팅의 일부로 사용할 수 있습니다. 또한 표시된 UI 요소에 연결된 모델이 표시기가 활성화되어 있을 때 생성된 모든 제스처 데이터의 "소스" 값이 됩니다.

예제

다음 코드 예제에서는 AdornerPanel을 사용하여 디자인 타임에 표시된 컨트롤의 Background 속성을 설정하는 데 사용되는 Slider 컨트롤을 호스팅하는 방법을 보여 줍니다. 자세한 내용은 연습: 디자인 타임 표시기 만들기를 참조하십시오.

' Setup the adorner panel.
' All adorners are placed in an AdornerPanel
' for sizing and layout support.
Dim myPanel = Me.Panel

AdornerPanel.SetHorizontalStretch(opacitySlider, AdornerStretch.Stretch)
AdornerPanel.SetVerticalStretch(opacitySlider, AdornerStretch.None)

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)
// Setup the adorner panel.
// All adorners are placed in an AdornerPanel
// for sizing and layout support.
AdornerPanel myPanel = this.Panel;

AdornerPanel.SetHorizontalStretch(opacitySlider, AdornerStretch.Stretch);
AdornerPanel.SetVerticalStretch(opacitySlider, AdornerStretch.None);

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);

상속 계층 구조

System.Object
  System.Windows.Threading.DispatcherObject
    System.Windows.DependencyObject
      System.Windows.Media.Visual
        System.Windows.UIElement
          System.Windows.FrameworkElement
            System.Windows.Controls.Panel
              Microsoft.Windows.Design.Interaction.AdornerPanel

스레드로부터의 안전성

이 형식의 모든 공용 static(Visual Basic의 경우 Shared) 멤버는 스레드로부터 안전합니다. 인터페이스 멤버는 스레드로부터 안전하지 않습니다.

참고 항목

참조

AdornerPanel 멤버

Microsoft.Windows.Design.Interaction 네임스페이스

기타 리소스

표시기 아키텍처

레이아웃 공간 및 렌더링 공간

기능 공급자 및 기능 커넥터