StackPanel.Orientation 속성

정의

자식 요소가 누적되는 크기를 나타내는 값을 가져오거나 설정합니다.

public:
 property System::Windows::Controls::Orientation Orientation { System::Windows::Controls::Orientation get(); void set(System::Windows::Controls::Orientation value); };
public System.Windows.Controls.Orientation Orientation { get; set; }
member this.Orientation : System.Windows.Controls.Orientation with get, set
Public Property Orientation As Orientation

속성 값

자식 콘텐츠의 Orientation입니다.

예제

다음 예제에서는 사용 하는 방법을 보여 줍니다 합니다 Orientation 속성을 지정 하는 방법을 내의 요소를 StackPanel (다른를 나란히 비교를 기반으로 하나)를 누적 됩니다.

<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">

  <!-- This StackPanel stacks two other StackPanels on top of each other. The
       first StackPanel stacks its items horizontally while the second stacks them
       vertically. -->
  <StackPanel>

    <!-- The items under this StackPanel are stacked horizontally. -->
    <StackPanel Orientation="Horizontal">
      <Border Background="SkyBlue">
        <TextBlock>Stacked Item #1</TextBlock>
      </Border>
      <Border Background="CadetBlue">
        <TextBlock>Stacked Item #2</TextBlock>
      </Border>
      <Border Background="LightGoldenRodYellow">
        <TextBlock>Stacked Item #3</TextBlock>
      </Border>
    </StackPanel>

    <!-- The items under this StackPanel are stacked Vertically. Note that Orientation 
         has a default value of "Vertical" but in this example the property is explicitely
         set for clarity. -->
    <StackPanel Orientation="Vertical">
      <Border Background="SkyBlue">
        <TextBlock>Stacked Item #1</TextBlock>
      </Border>
      <Border Background="CadetBlue">
        <TextBlock>Stacked Item #2</TextBlock>
      </Border>
      <Border Background="LightGoldenRodYellow">
        <TextBlock >Stacked Item #3</TextBlock>
      </Border>
    </StackPanel>
  </StackPanel>
  
</Page>

다음 스크린샷은이 예제에서 렌더링 하는 방법을 보여 줍니다.

StackPanel 방향

설명

종속성 속성 정보

식별자 필드 OrientationProperty
메타 데이터 속성 설정 true AffectsMeasure

적용 대상