Popup.Child 속성

정의

Popup 컨트롤의 콘텐츠를 가져오거나 설정합니다.

public:
 property System::Windows::UIElement ^ Child { System::Windows::UIElement ^ get(); void set(System::Windows::UIElement ^ value); };
[System.ComponentModel.Bindable(true)]
public System.Windows.UIElement Child { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.Child : System.Windows.UIElement with get, set
Public Property Child As UIElement

속성 값

UIElement

Popup 컨트롤의 UIElement 콘텐츠입니다. 기본값은 null입니다.

특성

예제

다음 예제에서는 콘텐츠를 추가 하는 방법을 보여 줍니다는 Popup 제어 합니다.

Popup myPopupWithText = new Popup();
TextBlock textBlock = new TextBlock();
textBlock.Text = "Popup Text";
textBlock.Background = Brushes.Yellow;
myPopupWithText.Child = textBlock;
myStackPanel.Children.Add(myPopup);
Dim myPopupWithText As New Popup()
Dim textBlock As New TextBlock()
textBlock.Text = "Popup Text"
textBlock.Background = Brushes.Yellow
myPopupWithText.Child = textBlock
myStackPanel.Children.Add(myPopup)
<DockPanel>
  <Popup IsOpen="True">
    <TextBlock Background="Yellow">Popup Text</TextBlock>
  </Popup>
</DockPanel>

설명

콘텐츠 모델: 합니다 Child 속성에 대 한 콘텐츠 속성은는 Popup 제어 합니다. A Popup 하나만 UIElement 으로 자식, 하지만 해당 자식에 포함 된 복잡 한 콘텐츠 포함 될 수 있습니다. 예를 들어, 자식 수를 StackPanel 포함 하는 Image, 텍스트 및 다른 유형의 컨트롤입니다.

에 콘텐츠 추가 되는 경우는 Popup 컨트롤을 Popup 컨트롤은 콘텐츠를 논리적 부모가 됩니다. 마찬가지로, 합니다 Popup 콘텐츠의 논리적 자식으로 간주 됩니다는 Popup합니다. 자식 콘텐츠가 포함 된 시각적 트리에 추가 되지 않습니다는 Popup 제어 합니다. 자체 시각적 개체를 사용 하 여 별도 창에서 자식 콘텐츠를 렌더링할 하는 대신 경우 트리를 IsOpen 로 설정 된 true합니다.

종속성 속성 정보

식별자 필드 ChildProperty
메타 데이터 속성 설정 true 없음

적용 대상