블로그 이미지
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

'.Net Project/SilverLight 3.0'에 해당되는 글 63

  1. 2009.12.02 53장 Calendar 컨트롤
  2. 2009.12.02 52장 Tab 컨트롤
  3. 2009.12.02 51장 Slider 컨트롤
  4. 2009.12.02 50장 ProgressBar 컨트롤
2009. 12. 2. 16:59 .Net Project/SilverLight 3.0
반응형
  Calendar 컨트롤
 - 달력을 화면에 표시하고 사용자가 날짜를 선택할 수 있는 컨트롤
 - Calendar 컨트롤은 다음과 같이 주요 속성에 에 따라 지정하여 사용 가능

  Calendar.Xaml





<UserControl xmlns:my="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"  x:Class="RiaCalendar.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:Calendar x:Name="cal" Background="Bisque"

                         FontFamily="Arial"

                         FontSize="20"

                         BorderBrush="Green"

                         BorderThickness="5">       

            </my:Calendar> 

            <TextBlock x:Name="lblDisplay" Width="150" Height="50"></TextBlock>

        </StackPanel>       

    </Grid>

</UserControl> 

  Calendar.Cs

using System;

using System.Collections.Generic;

using System.Linq;

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 RiaCalendar

{

    public partial class MainPage : UserControl

    {

        public MainPage()

        {

            InitializeComponent();

 

            this.cal.SelectedDatesChanged += new
               EventHandler
<SelectionChangedEventArgs>(cal_SelectedDatesChanged);

        }

 

        void cal_SelectedDatesChanged(object sender, SelectionChangedEventArgs e)

        {

            //lblDisplay.Text = cal.SelectedDate.ToString();

            lblDisplay.Text = String.Format
                              (
"{0:yyyy-MM-dd hh:mm:ss}", cal.SelectedDate);

        }

    }

} 





반응형

'.Net Project > SilverLight 3.0' 카테고리의 다른 글

55장 스타일 사용 컨트롤 조작(Style)  (0) 2009.12.03
54장 바인딩 컨트롤(Grid.Resource)  (0) 2009.12.03
52장 Tab 컨트롤  (0) 2009.12.02
51장 Slider 컨트롤  (0) 2009.12.02
50장 ProgressBar 컨트롤  (0) 2009.12.02
posted by Magic_kit
2009. 12. 2. 16:12 .Net Project/SilverLight 3.0
반응형

  Tab Control
 - 단일 항목과 헤더를 표시하는 컨트롤을 앞에서 살펴본 ContentControl상속 받아서
   구현된 단일 항목을 표시하는 컨트롤과 헤더의 조합 컨트롤 의미

 - 단일 항목과 헤더를 표시하는 컨트롤은 TabItem 컨트롤이 있으며, TabControl의 자식 Item으로 사용


 Tab Control.Xaml


<UserControl x:Class="TabExample.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:DesignWidth="640" d:DesignHeight="480">

    <Grid Width="200" Height="300" xmlns:controls="clr-
          namespace:System.Windows.Controls;assembly=System.Windows.Controls">

        <controls:TabControl>

            <!-- TabItem 추가및 헤더 설정 -->

            <controls:TabItem Header="¨ªö¨¬¡¢ç C" >

                <!-- TabItem 콘텐츠 설정 -->

                <controls:TabItem.Content>

                    <ScrollViewer HorizontalScrollBarVisibility="Auto"
                                  VerticalScrollBarVisibility
="Auto">

                        <TextBlock Width="400" TextWrapping="Wrap" Text="jQuery UI provides abstractions for low-level interaction and animation, advanced effects and high-level, themeable widgets, built on top of the jQuery JavaScript Library, that you can use to build highly interactive web applications." />

                    </ScrollViewer>

                </controls:TabItem.Content>

            </controls:TabItem>

 

            <!-- TabItem 추가 -->

            <controls:TabItem>

                <!-- TabItem 헤더 설정  -->

                <controls:TabItem.Header>

                    <StackPanel Orientation="Horizontal">

                        <Image Source="star.png" Width="20" Height="20"/>

                        <TextBlock Margin="2" Text="이미지 탭" />

                    </StackPanel>

                </controls:TabItem.Header>

                <!-- TabItem 콘텐츠 설정 -->

                <controls:TabItem.Content>

                    <ScrollViewer HorizontalScrollBarVisibility="Auto"

                                  VerticalScrollBarVisibility="Auto">

                        <Image Source="star.png"/>

                    </ScrollViewer>

                </controls:TabItem.Content>

            </controls:TabItem>

        </controls:TabControl>

    </Grid>

</UserControl> 




반응형

'.Net Project > SilverLight 3.0' 카테고리의 다른 글

54장 바인딩 컨트롤(Grid.Resource)  (0) 2009.12.03
53장 Calendar 컨트롤  (0) 2009.12.02
51장 Slider 컨트롤  (0) 2009.12.02
50장 ProgressBar 컨트롤  (0) 2009.12.02
49장 ListBox 컨트롤  (0) 2009.12.02
posted by Magic_kit
2009. 12. 2. 16:01 .Net Project/SilverLight 3.0
반응형
  Slider 컨트롤
- 특정한 범위의 값 내에서 사용자로부터 임의의 값을 선택 받는 UI에 사용 가능
- Orientation 프로퍼티를 설정하여 컨트롤의 방향을 설정 할 수 있으며, 프로퍼티를 설정하여
  값이 증가하는 방향을 설정 가능

 Slider.Xaml

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

        <MediaElement x:Name="media" Width="640" Height="480"

                          Source="Silverlight.wmv">           

        </MediaElement>      

        <TextBlock Text="Volume"></TextBlock>

 

        <Slider x:Name="slider"

                Maximum="1" Minimum="0"

                Width="200" Value="0.5" Height="50" SmallChange="0.1">           

        </Slider> 

    </Grid>

</UserControl> 

  Slider.Cs

using System;

using System.Collections.Generic;

using System.Linq;

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 RiaSlider

{

    public partial class MainPage : UserControl

    {

        public MainPage()

        {

            InitializeComponent();

            this.slider.ValueChanged += new
            RoutedPropertyChangedEventHandler
<double>(slider_ValueChanged);

        }

 

        void slider_ValueChanged(object sender,
                                  RoutedPropertyChangedEventArgs
<double> e)

        {

            // 0~1까지 볼륨 조절 가능

            this.media.Volume = this.slider.Value;

        }

    }

} 





반응형

'.Net Project > SilverLight 3.0' 카테고리의 다른 글

53장 Calendar 컨트롤  (0) 2009.12.02
52장 Tab 컨트롤  (0) 2009.12.02
50장 ProgressBar 컨트롤  (0) 2009.12.02
49장 ListBox 컨트롤  (0) 2009.12.02
48장 ComboBox 컨트롤  (0) 2009.12.02
posted by Magic_kit
2009. 12. 2. 15:31 .Net Project/SilverLight 3.0
반응형
  ProgressBar
 - 작업의 진행 상태와 같은 UI를 표시하기 위해서 사용 가능
 - IsIndeterminate 프로퍼티를 설정하여 진행 상태를 두 가지 형태로 표시 가능


  ProgressBar.Xaml
 


<
UserControl x:Class="ProgressBarExample.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:DesignWidth="640" d:DesignHeight="480">

    <StackPanel>

        <StackPanel>

            <StackPanel Orientation="Horizontal" Height="20" Width="300">

                <Button x:Name="btnMinus"

                        Content="-10" Click="btnMinus_Click"

                        Width="30" Height="20"/>

                <Button x:Name="btnPlus" Content="+10"

                        Click="btnPlus_Click" Width="30" Height="20"/>

            </StackPanel>

            <TextBox Text="IsIndeterminate False" Height="20" Width="300" />

            <ProgressBar x:Name="pgbar1"

                         Height="20" Width="300" Value="50"

                         Minimum="0" Maximum="100" IsIndeterminate="False" />

        </StackPanel>

        <StackPanel>

            <TextBox Text="IsIndeterminateTrue " Height="20" Width="300" />

            <ProgressBar x:Name="pgbar2" Height="20" Width="300"

                         IsIndeterminate="True" />

        </StackPanel>

    </StackPanel>

</UserControl>

 ProgressBar .Cs

using System;

using System.Collections.Generic;

using System.Linq;

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 ProgressBarExample

{

    public partial class MainPage : UserControl

    {

        public MainPage()

        {

            InitializeComponent();

        }

 

        private void btnMinus_Click(object sender, RoutedEventArgs e)

        {

            //pgbar1 ProgressBar Value 10 감소 

            pgbar1.Value -= 10;

        }

 

        private void btnPlus_Click(object sender, RoutedEventArgs e)

        {

            //pgbar1 ProgressBar Value 10 증가

            pgbar1.Value += 10;

        }

    }

} 





반응형

'.Net Project > SilverLight 3.0' 카테고리의 다른 글

52장 Tab 컨트롤  (0) 2009.12.02
51장 Slider 컨트롤  (0) 2009.12.02
49장 ListBox 컨트롤  (0) 2009.12.02
48장 ComboBox 컨트롤  (0) 2009.12.02
47장 RoutedEventArgs 컨트롤  (0) 2009.12.01
posted by Magic_kit
prev 1 2 3 4 5 6 7 ··· 16 next