블로그 이미지
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. 12. 1. 09:08 .Net Project/SilverLight 3.0
반응형
  Canvas (도화지 같은 역활을 하는 기능을 의미)
  CanvasClip 사용 예제  Stroke, StrokeThickness 속성 사용


<UserControl x:Class="RiaCanvasClip.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">
   

        <Canvas x:Name="redCanvas"

                Background="White"

                Width="200" Height="200">

        <Rectangle Canvas.Left="0" Canvas.Top="0" Fill="Red"

                       Width="50" Height="50">           

        </Rectangle>

        <Rectangle Canvas.Left="20" Canvas.Top="20" Fill="Green"

                       Width="50" Height="50">           

        </Rectangle>

        <Rectangle Canvas.Left="40" Canvas.Top="40" Fill="Blue"

                       Width="50" Height="50">

        </Rectangle>

        </Canvas>  

</UserControl> 


 Canvas 에서 Z-INDEX 적용


<UserControl x:Class="RiaCanvasClip.FrmCanvasZIndex"

    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">

 

        <Canvas x:Name="redCanvas"

                Background="White"

                Width="200" Height="200">

            <Rectangle Canvas.Left="0" Canvas.Top="0" Fill="Red"

                       Width="50" Height="50" Canvas.ZIndex="2">

            </Rectangle>

            <Rectangle Canvas.Left="20" Canvas.Top="20" Fill="Green"

                       Width="50" Height="50" Canvas.ZIndex="1">

            </Rectangle>

            <Rectangle Canvas.Left="40" Canvas.Top="40" Fill="Blue"

                       Width="50" Height="50" Canvas.ZIndex="0">

            </Rectangle>

           

        </Canvas>

    </Grid>

</UserControl>


 FrmCanvasLayout 사용 방법) Size.. (Width, Height) 
      Canvas 안에 도형을 생성 할때 Size 속성을 사용하여 크게나 작게나 Canvas 안에 추가 가능하다.


<UserControl x:Class="RiaCanvasClip.FrmCanvasLayout"

    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">

        <Canvas Width="100" Height="100" Background="Blue">

            <Ellipse Width="50" Height="50" Fill="Red"></Ellipse>

           

        </Canvas>

    </Grid>

</UserControl> 


  CanvasLayout (Canvas 실버라이트 영역 HTML 영역) 분리



<head>

    <title>RiaCanvasClip</title>

    <style type="text/css">

    html, body {

                      height: 100%;

                      overflow: auto;

    }

    body {

                      padding: 0;

                      margin: 0;

    }

    #silverlightControlHost {

                      height: 300px;

                      width:400px;

                      text-align:center;

    } 
<head>







반응형
posted by Magic_kit
2009. 11. 27. 16:23 .Net Project/SilverLight 3.0
반응형
  RadioButton
- CheckBox 컨트롤과 마찬가지로 ToggleButton을 상속받아 구현된 컨트롤
- 선택/미선택 같은 UI에 사용 가능
- Checked 상태가 그룹 내에서 오직 한개의 RadioButton에만 적용 되도록 할 수 있습니다.
- GroupName 프로퍼티 설정하여 그룹핑을 할 수 있으며, IsChecked 프로퍼티 참조하여 RadioButton적용


  RadioButton.Xaml

<UserControl x:Class="RiaRadioButton.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">

 

    <StackPanel Orientation="Vertical">

        <TextBlock Text="Do you Like Subject??"></TextBlock>

        <StackPanel Orientation="Horizontal">

            <RadioButton Width="80" Content="Silverlight"
                   GroupName="Fruit" Checked="RadioButton_Checked"></RadioButton>

            <RadioButton Width="80" Content="ASP.NET"
                 
 GroupName="Fruit" Checked="RadioButton_Checked"
                   IsChecked="True"></RadioButton>

            <RadioButton Width="80" Content="WPF"
                   GroupName="Fruit" Checked="RadioButton_Checked"></RadioButton>

        </StackPanel>

        <TextBlock x:Name="txtBlkSelFruit" Text="Subject"></TextBlock>

        <TextBlock Text="Sbject Method??"></TextBlock>

        <StackPanel Orientation="Horizontal">

            <RadioButton Width="80" Content="C#"
                         GroupName="Car" Checked="RadioButton_Checked_1"
                         IsChecked
="True"></RadioButton>

            <RadioButton Width="80" Content="VB"
                         GroupName="Car"
                       
 Checked="RadioButton_Checked_1" ></RadioButton>

            <RadioButton Width="80" Content="API"
                       
 GroupName="Car"
                         Checked
="RadioButton_Checked_1"></RadioButton>

        </StackPanel>

        <TextBlock x:Name="txtBlkSelCar" Text="MFC"></TextBlock>

    </StackPanel>     

</UserControl> 

  RadioButton.Cs

using System.Net;

using System.Windows;

using System.Windows.Controls;

using System.Windows.Documents;

using System.Windows.Input;

using System.Windows.Media;

using System.Windows.Media.Animation;

using System.Windows.Shapes;

 

namespace RiaRadioButton

{

    public partial class MainPage : UserControl

    {

        public MainPage()

        {

            InitializeComponent();

        }

        /// <summary>

        /// Handle Fruit

        /// </summary>

        /// <param name="sender"></param>

        /// <param name="e"></param>

        private void RadioButton_Checked(object sender, RoutedEventArgs e)

        {

            RadioButton rb = sender as RadioButton;

            if (txtBlkSelFruit != null)

            {

                //Fruit Group

                txtBlkSelFruit.Text = rb.Content as string;               

            } 

        }

        /// <summary>

        /// HandelCar

        /// </summary>

        /// <param name="sender"></param>

        /// <param name="e"></param>

        private void RadioButton_Checked_1(object sender, RoutedEventArgs e)

        {

            RadioButton rb = sender as RadioButton;

            if (txtBlkSelCar != null)

            {

                //CarGroup

                txtBlkSelCar.Text = rb.Content as string;

            } 

        } 





반응형
posted by Magic_kit
2009. 11. 27. 16:16 .Net Project/SilverLight 3.0
반응형
  CheckBox
- ToggleButton을 상속받아 구현된 컨트롤로 선택/미선택 같은 UI사용
- IsThreeState 프로퍼티의 설정값에 따라 CheckBox가 가질 수 잇는 상태
  CheckBox 사용방법


<UserControl x:Class="RiaContent.FrmCheckbox"

    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">

   

    <StackPanel>

        <CheckBox x:Name="chkboxTwoState" Content="Two StateCheck Box"

                  Checked="chkboxTwoState_Checked"
                  Unchecked
="chkboxTwoState_Unchecked"></CheckBox>

 

        <CheckBox x:Name="chkBoxThreeState" Content="Three State Checkbox"

                  Checked="chkBoxThreeState_Checked" 
                  
Unchecked
="chkBoxThreeState_Unchecked" ></CheckBox>
    </StackPanel>   

</UserControl> 




반응형
posted by Magic_kit
2009. 11. 27. 16:09 .Net Project/SilverLight 3.0
반응형
 HyperLink Button
- blank, _media, _search : 링크 페이지를 새로운 팝업창으로 띄웁니다
- _parent, _self, _top :  링크 페이지를 현재의 페이지 로드
- 문자열(Window Name) : 링크 페이지를 해당 이름을 가진 팝업창으로 띄웁니다
  HyperLink Button 사용 방법

<UserControl x:Class="RiaContent.FrmHyperLinkButton"

    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">

 

    <StackPanel>

        <HyperlinkButton Content="_blink Move"
                       
 NavigateUri="fool8585.tistory.com"
                         TargetName
="_blank"></HyperlinkButton>

        <HyperlinkButton Content="_self Move"
                       
 NavigateUri="fool8585.tistory.com"
                         TargetName
="_self"></HyperlinkButton>

  </StackPanel>

</UserControl> 




반응형
posted by Magic_kit