블로그 이미지
Magic_kit
study 관련자료를 한곳으로 자기 개발 목적으로 재태크 재무 관리 목적으로 일상생활의 팁을 공유 하기 위하여 블로그를 개설 하였습니다.

calendar

1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
반응형

Category

Recent Post

Recent Comment

Archive

2009. 11. 25. 16:40 .Net Project/SilverLight 3.0
반응형
 - 패내마외 & 좌상우하
 

<UserControl x:Class="RiaPaddingAndMargin.MainPage"

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

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

    mc:Ignorable="d"

    d:DesignHeight="300" d:DesignWidth="400">

 

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

        <StackPanel Background="Pink" Margin="30"  >

            <TextBlock Text="안쪽 바깥쪽 여백 표현"
                     
 FontSize="20"
                       HorizontalAlignment
="Center" 
                       Margin
="0,10,0,0"></TextBlock>

            <Button x:Name="btnContent"
                    
 Content="패내마외" FontSize="15"
                    
 Padding="10" Margin="10"></Button>

            <Button x:Name="btnResult" Content="좌상우하"
                   
  FontSize="15" Margin="10,5,10,5"
                      padding
="10,10,10,10"></Button>

            <Button x:Name="btnResult1" Content="패내마외"
                   
  FontSize="15"
                      Margin
="10,5,10,5" Padding="10,10,10,10"></Button>

            <Button x:Name="btnResult2" Content="좌상우하"
                   
  FontSize="15"
                   
 Margin="10,5,10,5"
                     Padding
="10,10,10,10"></Button>           

        </StackPanel>

    </Grid>

</UserControl> 




반응형
posted by Magic_kit
2009. 11. 25. 16:33 .Net Project/SilverLight 3.0
반응형
-  DockPanel
  자식 컨트롤을 특정 방향으로 도킹시키고자 할 경우 사용하는 레이아웃 컨트롤 입니다.
  DockPanel 역시 실버라이트 툴킷을 설치해야 추가되는 컨트롤로 툴킷을 설치하는 WrapPanel 참고

- DockPanel 사용하기 위해서는 

  
 

<UserControl xmlns:my="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"  x:Class="RiaDockPanel.MainPage"

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

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

    mc:Ignorable="d"

    d:DesignHeight="300" d:DesignWidth="400">

 

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

    <my:DockPanel LastChildFill="False">

            <Button x:Name="btn" Content="DockPanel"></Button>

            <Button x:Name="btnResult1"
                  
 Content="DockPanel" my:DockPanel.Dock="Top"></Button>

            <Button x:Name="btnResult2"
                  
 Content="DockPanel" my:DockPanel.Dock="Right"></Button>

            <Button x:Name="btnResult3"
                    Content="DockPanel" my:DockPanel.Dock="Bottom"></Button>

        </my:DockPanel>

    </Grid>

</UserControl> 






반응형
posted by Magic_kit
2009. 11. 25. 16:28 .Net Project/SilverLight 3.0
반응형
-  WrapPanel
  WrapPanel은 Stack Panel처럼 자신 엘리먼트를 수평이나 수직으로 배치할 때 사용합니다.
  WrapPanel의 Wrap은 컴퓨터 용어로써, '다음 행으로 넘어가다'라는 뜻으로 가지고 있습니다.

- 마이크로소프트 실버라이트 툴킷 설치하기
  www.silverlight.net -> GetStard 에서 툴킷 설치.... 후 추가 완료 한다

- WrapPanel 와 StrackPanel 비교


  StackPanel은 레이블 벗어 나게 되면 그대로 가서 보이지 않게 되지만
  WrapPanel은 벗어나더라도 다음줄로 자동으로 이동하여 화면에 표시 된다
 

<UserControl xmlns:my="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"  x:Class="RiaWrapPanel.MainPage"

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

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

    mc:Ignorable="d"

    d:DesignHeight="300" d:DesignWidth="400">

 

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

        <StackPanel>

            <my:WrapPanel Width="300"
                          Background
="Green" Orientation="Horizontal">

                <Button x:Name="btnResult4"
                         
 Content="WrapPanel"
                          
 Width="100" Height="50"  ></Button>

                <Button x:Name="btnResult5" Content="WrapPanel"
                        
 Width="100" Height="50"  ></Button>

                <Button x:Name="btnResult6" Content="WrapPanel"
                        
 Width="100" Height="50"  ></Button>

                <Button x:Name="btnResult7" Content="WrapPanel"
                        
 Width="100" Height="50"  ></Button>

            </my:WrapPanel>

           

            <StackPanel Width="300" Background="Yellow" Orientation="Horizontal">

                <Button x:Name="btnResult" Content="StackPanel"
                          Width="100" Height="50"  ></Button>

                <Button x:Name="btnResult1" Content="StackPanel"
                        
 Width="100" Height="50"  ></Button>

                <Button x:Name="btnResult2" Content="StackPanel"
                        
 Width="100" Height="50"  ></Button>

                <Button x:Name="btnResult3" Content="StackPanel"
                        
 Width="100" Height="50"  ></Button>

            </StackPanel>

       </StackPanel>

    </Grid>

</UserControl> 




반응형
posted by Magic_kit
2009. 11. 25. 16:13 .Net Project/SilverLight 3.0
반응형
- Grid
  그리드(Grid)는 실버라이트에서 제공하는 가장 강력한 레이아웃 컨트롤 입니다
  그리드를 이용하면 행과 열을 정의해 셀로 나눈 후 자신 컨트롤을 나누어진 셀에 배치 가능

- 화면 표시
 

<UserControl x:Class="RiaGrid.MainPage"

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

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

    mc:Ignorable="d"

    d:DesignHeight="300" d:DesignWidth="400">

 

    <Grid x:Name="ctlList"
        
 Background="DarkOrange" ShowGridLines="True" Width="400" Height="300">

        <Grid.RowDefinitions>

            <RowDefinition Height="50"></RowDefinition>

            <RowDefinition Height="100"></RowDefinition>

            <RowDefinition Height="Auto"></RowDefinition>

            <RowDefinition Height="Auto"></RowDefinition>

            <RowDefinition Height="Auto"></RowDefinition>

            <RowDefinition Height="Auto"></RowDefinition>

            <RowDefinition Height="Auto"></RowDefinition>

        </Grid.RowDefinitions>

       

        <Grid.ColumnDefinitions>

            <ColumnDefinition Width="2*"></ColumnDefinition>

            <ColumnDefinition Width="3*"></ColumnDefinition>

          

        </Grid.ColumnDefinitions>

        <TextBlock x:Name="lblText" Text="1행1열" ></TextBlock>

        <Button x:Name="btnName"
                
 Content="클릭버튼"
                 
 Grid.Row="0" Grid.Column="1" Width="100" Height="30"></Button>

        <TextBox x:Name="txtName" Text="2행1열"
                  Grid.Row="1" Grid.Column="0" Grid.RowSpan="2"></TextBox>

        <Button x:Name="cmdResult" Content="3행3열"
               
 Grid.Row="2" Grid.Column="0"
               
 Grid.ColumnSpan="2" FontSize="20"></Button>

        <TextBox x:Name="txtNumber" Text="4행4열"
               
 Grid.Row="3" Grid.Column="0"></TextBox>

        <TextBox x:Name="txtAddress" Text="5행 5열"
               
 Grid.Row="4" Grid.Column="0"></TextBox>

        <TextBox x:Name="txtGac" Text="5행 5열"
               
 Grid.Row="5" Grid.Column="0"></TextBox>

        <TextBox x:Name="txtGaA" Text="6행 6열"
               
 Grid.Row="6" Grid.Column="0"></TextBox>

       

        <Button x:Name="cmd" Content="속성"
                
 Foreground="Black" Grid.Row="3" Grid.Column="1"

                 HorizontalAlignment="Left" VerticalAlignment="Bottom"></Button>

        <Button x:Name="cmd1" Content="속성1"
                
 Foreground="Black" Grid.Row="4" Grid.Column="1"

                 HorizontalAlignment="Right" VerticalAlignment="Bottom"></Button>

        <Button x:Name="cmd2" Content="속성2"
                 Foreground
="Black" Grid.Row="5" Grid.Column="1"

                 HorizontalAlignment="Center"
                 VerticalAlignment
="Bottom"></Button>

        <Button x:Name="cmd3" Content="속성3"
                 Foreground
="Black" Grid.Row="6" Grid.Column="1"

                 HorizontalAlignment="Stretch" 
                 VerticalAlignment
="Bottom"></Button>
 

    </Grid>    

</UserControl> 




반응형
posted by Magic_kit