패널 콘텐츠 모델 개요

업데이트: 2007년 11월

이 콘텐츠 모델 개요에서는 Panel에 대해 지원되는 콘텐츠를 설명합니다. StackPanelDockPanelPanel 개체의 예제입니다.

이 항목에는 다음 단원이 포함되어 있습니다.

  • 패널 콘텐츠 속성
  • 자식 속성 사용
  • 이 콘텐츠 모델을 공유하는 형식
  • 패널 개체를 포함할 수 있는 형식
  • 관련 항목

패널 콘텐츠 속성

Panel의 콘텐츠 속성은 다음과 같습니다.

자식 속성 사용

Children 속성에는 여러 개체, 심지어는 다른 Panel 개체도 포함될 수 있습니다. 다음 예제에서는 Children 속성을 사용하여 두 Button 개체를 StackPanel에 추가하는 방법을 보여 줍니다.

<Page  xmlns="https://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="https://schemas.microsoft.com/winfx/2006/xaml">
  <StackPanel>
    <Button>Button 1</Button>
    <Button>Button 2</Button>
  </StackPanel>
</Page>
using System;
using System.Windows;
using System.Windows.Controls;

namespace SDKSample
{
    public partial class StackpanelExample : Page
    {
        public StackpanelExample()
        {
            // Create two buttons
            Button myButton1 = new Button();
            myButton1.Content = "Button 1";
            Button myButton2 = new Button();
            myButton2.Content = "Button 2";

            // Create a StackPanel
            StackPanel myStackPanel = new StackPanel();

            // Add the buttons to the StackPanel
            myStackPanel.Children.Add(myButton1);
            myStackPanel.Children.Add(myButton2);

            this.Content = myStackPanel;
        }
    }
}

이 콘텐츠 모델을 공유하는 형식

다음 클래스는 Panel 클래스에서 상속됩니다.

패널 개체를 포함할 수 있는 형식

WPF 콘텐츠 모델을 참조하십시오.

참고 항목

개념

Panel 개요