Silverlight

12.SilverLight3 - Layout - WrapPanel

Godffs 2009. 11. 25. 08:57
반응형
레이아웃 확장 : WrapPanel
WrapPanel
- StackPanel와 비슷하지만 다릅니다. WrapPanel은 다음 행으로 넘기는 뜻으로 컨트롤이 추가된 공간이
   부족한 경우
다음 행으로 자동으로 내립니다. StackPanel은 추가된 공각인 부족하더라고 그냥 출력하기
   때문에 짤리는것을 확인 할 수 있습니다.


WrapPanel 컨트롤은 실버라이트에서 기본적으로 제공되지 않습니다.
사용하기 위해서는 SilverLight Toolkit 을 설치해 주셔야 합니다.
(그 밖에 다른 유용한 컨트롤이 있으니 설치해주세요)

SilverLight Toolkit 설치 방법 및 어셈블리 추가하는 방법입니다.

MainPage.xaml

[그림 12-4]


<Grid x:Name="LayoutRoot" Background="White">

        <StackPanel>

            <!--WrapPanel 컨트롤 사용-->

            <my:WrapPanel Width="250" Background="DarkCyan" Orientation="Horizontal">

                <Button Content="1" Width="100" Height="50"></Button>

                <Button Content="1" Width="100" Height="50"></Button>

                <Button Content="1" Width="100" Height="50"></Button>

                <Button Content="1" Width="100" Height="50"></Button>

            </my:WrapPanel>


            <!--StackPanel 컨트롤 사용-->

            <StackPanel Width="300" Height="100" Background="DarkBlue"

                        Orientation="Horizontal">

                <Button Content="1" Width="100" Height="50"></Button>

                <Button Content="1" Width="100" Height="50"></Button>

                <Button Content="1" Width="100" Height="50"></Button>

                <Button Content="1" Width="100" Height="50"></Button>

            </StackPanel>

        </StackPanel>

</Grid>



반응형