Wow! Silverlight TextBlock_XAML"> Wow! Silverlight TextBlock_XAML">

Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Rich Internet Application 2010 1 학기 동서대학교 김남우. 2/12 Control Text Control 1.TextBlock 2.TextBox 3.PasswordBox Content Control 1.Button 2.CheckBox 3.ListBoxItem.

Similar presentations


Presentation on theme: "1 Rich Internet Application 2010 1 학기 동서대학교 김남우. 2/12 Control Text Control 1.TextBlock 2.TextBox 3.PasswordBox Content Control 1.Button 2.CheckBox 3.ListBoxItem."— Presentation transcript:

1 1 Rich Internet Application 2010 1 학기 동서대학교 김남우

2 2/12 Control Text Control 1.TextBlock 2.TextBox 3.PasswordBox Content Control 1.Button 2.CheckBox 3.ListBoxItem 4.ComboBoxItem Content Control & Header TabItem Item Control ListBox ComboBox & ComboBoxItem Range Control ProgressBar Slider ScrollBar Calendar & DatePicker Control

3 3/12 <UserControl x:Class="SilverlightApplication1.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"> Wow! Silverlight TextBlock_XAML

4 4/12 public partial class MainPage : UserControl { public MainPage() { InitializeComponent(); this.Loaded += new RoutedEventHandler(MainPage_Loaded); } void MainPage_Loaded(object sender, RoutedEventArgs e) { TextBlock txtBlock = new TextBlock(); SolidColorBrush txtBlueBrush = new SolidColorBrush(); txtBlueBrush.Color = Colors.Blue; txtBlock.Foreground = txtBlueBrush; txtBlock.FontFamily = new FontFamily("Arial"); txtBlock.FontSize = 80; txtBlock.FontWeight = FontWeights.Bold; txtBlock.FontStyle = FontStyles.Italic; txtBlock.Text = "Wow! Silverlight“; LayoutRoot.Children.Add(txtBlock); } TextBlock_C#

5 5/12 <UserControl x:Class="SilverlightApplication1.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"> Wow! Silverlight TextBlock_Inlines_XAML

6 6/12 void MainPage_Loaded(object sender, RoutedEventArgs e) { TextBlock txtBlock = new TextBlock(); Run txtRun1 = new Run(); SolidColorBrush txtBlueBrush = new SolidColorBrush(); txtBlueBrush.Color = Colors.Blue; txtRun1.Foreground = txtBlueBrush; txtRun1.FontFamily = new FontFamily("Arial"); txtRun1.FontSize = 80; txtRun1.FontWeight = FontWeights.Bold; txtRun1.FontStyle = FontStyles.Italic; txtRun1.Text = "Wow!“; txtBlock.Inlines.Add(txtRun1); txtBlock.Inlines.Add(new LineBreak()); Run txtRun2 = new Run(); SolidColorBrush txtOrangeBrush = new SolidColorBrush(); txtOrangeBrush.Color = Colors.Orange; txtRun2.Foreground = txtGoldBrush; txtRun2.FontFamily = new FontFamily("Courier New"); txtRun2.FontSize = 50; txtRun2.FontWeight = FontWeights.Bold; txtRun2.Text = "Silverlight“; txtBlock.Inlines.Add(txtRun2); LayoutRoot.Children.Add(txtBlock); } TextBlock_Inlines_C#

7 7/12 <UserControl x:Class="SilverlightApplication1.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"> TextWrapping="Wrap" 사용 예 TextBox_XAML

8 8/12 void MainPage_Loaded(object sender, RoutedEventArgs e) { TextBox txtBox = new TextBox(); txtBox.Width = 150; txtBox.Height = 100; SolidColorBrush txtBlueBrush = new SolidColorBrush(); txtBlueBrush.Color = Colors.Blue; txtBox.Foreground = txtBlueBrush; txtBox.FontFamily = new FontFamily("Arial"); txtBox.FontSize = 20; txtBox.FontWeight = FontWeights.Bold; txtBox.FontStyle = FontStyles.Italic; txtBox.Text = "Wow! Silverlight“; LayoutRoot.Children.Add(txtBox); } TextBox_C#

9 9/12 <UserControl x:Class="PasswordBoxExample.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"> <PasswordBox HorizontalAlignment="Left" VerticalAlignment="Top" Width="200" Height="35" Password="Wow! Silverlight" PasswordChar="*"/> <PasswordBox HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,40,0,0" Width="200" Height="35" Password="Wow! Silverlight" PasswordChar="@"/> <PasswordBox HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,80,0,0" Width="200" Height="35" Password="Wow! Silverlight" PasswordChar="A"/> PasswordBox_XAML

10 10/12 void MainPage_Loaded(object sender, RoutedEventArgs e) { PasswordBox passWordBox1 = new PasswordBox(); passWordBox1.SetValue(Grid.HorizontalAlignmentProperty, HorizontalAlignment.Left); passWordBox1.SetValue(Grid.VerticalAlignmentProperty, VerticalAlignment.Top); passWordBox1.Width = 200; passWordBox1.Height = 35; passWordBox1.Password = "Wow! Silverlight "; passWordBox1.PasswordChar = '*'; LayoutRoot.Children.Add(passWordBox1); PasswordBox passWordBox2 = new PasswordBox(); passWordBox2.SetValue(Grid.HorizontalAlignmentProperty, HorizontalAlignment.Left); passWordBox2.SetValue(Grid.VerticalAlignmentProperty, VerticalAlignment.Top); passWordBox2.Margin = new Thickness(0, 40, 0, 0); passWordBox2.Width = 200; passWordBox2.Height = 35; passWordBox2.Password = "Wow! Silverlight "; passWordBox2.PasswordChar = '@'; LayoutRoot.Children.Add(passWordBox2); PasswordBox passWordBox3 = new PasswordBox(); passWordBox3.SetValue(Grid.HorizontalAlignmentProperty, HorizontalAlignment.Left); passWordBox3.SetValue(Grid.VerticalAlignmentProperty, VerticalAlignment.Top); passWordBox3.Margin = new Thickness(0, 80, 0, 0); passWordBox3.Width = 200; passWordBox3.Height = 35; passWordBox3.Password = "Wow! Silverlight "; passWordBox3.PasswordChar = 'A'; LayoutRoot.Children.Add(passWordBox3); } PasswordBox_C#

11 11/12 <UserControl x:Class="ContentControlExample.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“> <Rectangle Canvas.Left="0" Canvas.Top="0" Width="200" Height="100" Fill="Gold" RadiusX="15" RadiusY="15"/> ContentControl_XAML

12 12/12 Hover : Mouse Cursor 가 Button Control 위에 올라왔을 때 Click Press : Mouse 로 Button Control 을 눌렀을 때 Click Release : Mouse 로 Button Control 을 눌렀다가 땔 때 Click Button

13 13/12 Button public partial class MainPage : UserControl { public MainPage() { InitializeComponent(); } private void btnHover_Click(object sender, RoutedEventArgs e) { MessageBox.Show("Mouse Hover"); } private void btnPress_Click(object sender, RoutedEventArgs e) { MessageBox.Show("Mouse Presss"); } private void btnRelease_Click(object sender, RoutedEventArgs e) { MessageBox.Show("Mouse Release"); }

14 14/12 Delay : Mouse 로 RepeatButton Control 을 누른 후 Click Event 발생 반복 작업이 시작하기 전까지 대기하는 시간. 단위는 밀리세컨드 (Default : 250) Interval : Click Event 발생 후 다음 Click Event 발생까지의 간격. 단위는 밀리세컨드 (Default : 250) RepeatButton

15 15/12 <RepeatButton x:Name="btnMinusSec" Width="30" Height="30" Canvas.Left="5" Canvas.Top="10" Content="-" Click="btnMinusSec_Click"/> <TextBlock x:Name="txtBlkSec" Width="25" Height="30" Canvas.Left="40" Canvas.Top="15" Text="3 초 " TextAlignment="Center"/> <RepeatButton x:Name="btnPlusSec" Width="30" Height="30" Canvas.Left="70" Canvas.Top="10" Content="+" Click="btnPlusSec_Click"/> RepeatButton public partial class MainPage : UserControl { private Int32 playTime = 3; public MainPage() { InitializeComponent(); } private void btnMinusSec_Click(object sender, RoutedEventArgs e) { playTime = Math.Max(1, --playTime); txtBlkSec.Text = String.Format("{0} 초 ", playTime); } private void btnPlusSec_Click(object sender, RoutedEventArgs e) { playTime = Math.Min(60, ++playTime); txtBlkSec.Text = String.Format("{0} 초 ", playTime); }

16 16/12 _blank, _media, _search : Link Page 를 새로운 PopUP 창으로 띄움 _parent, _self, _top. “” : Link Page 를 현재의 Page 로 Load Window Name : Link Page 를 해당 이름을 가진 PopUP 창으로 띄움 HyperlinkButton

17 17/12 <UserControl x:Class="SilverlightApplication1.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"> <HyperlinkButton Content="_blank 로 이동 " NavigateUri="http://www.dongseo.ac.kr" TargetName="_blank"/> <HyperlinkButton Content="_self 로 이동 " NavigateUri="http://www.dongseo.ac.kr" TargetName="_self"/> HyperlinkButton

18 18/12 IsThreeState 가 True 일 경우 : Checked, Indeterminate, Unchecked IsThreeState 가 False 일 경우 : Checked, Unchecked Default 는 IsThreeState=“False” CheckBox

19 19/12 <UserControl x:Class="CheckBoxExample.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"> <CheckBox x:Name="chkBoxTwoState" Content="Two State CheckBox" Checked="chkBoxTwoState_Checked" Unchecked="chkBoxTwoState_Unchecked" /> <CheckBox x:Name="chkBoxThreeState" Content="Three State CheckBox" IsThreeState="True" Checked="chkBoxThreeState_Checked“ Indeterminate="chkBoxThreeState_Indeterminate" Unchecked="chkBoxThreeState_Unchecked" /> CheckBox

20 20/12 public partial class MainPage : UserControl { public MainPage() { InitializeComponent(); } private void chkBoxTwoState_Checked(object sender, RoutedEventArgs e) { //chkBoxTwoState 체크박스의 상태가 Checked 일 때 루틴 추가 } private void chkBoxTwoState_Unchecked(object sender, RoutedEventArgs e) { //chkBoxTwoState 체크박스의 상태가 Unchecked 일 때 루틴 추가 } private void chkBoxThreeState_Checked(object sender, RoutedEventArgs e) { //chkBoxThreeState 체크박스의 상태가 Checked 일 때 루틴 추가 } private void chkBoxThreeState_Indeterminate(object sender, RoutedEventArgs e) { //chkBoxThreeState 체크박스의 상태가 Indeterminate 일 때 루틴 추가 } private void chkBoxThreeState_Unchecked(object sender, RoutedEventArgs e) { //chkBoxThreeState 체크박스의 상태가 Unchecked 일 때 루틴 추가 } CheckBox


Download ppt "1 Rich Internet Application 2010 1 학기 동서대학교 김남우. 2/12 Control Text Control 1.TextBlock 2.TextBox 3.PasswordBox Content Control 1.Button 2.CheckBox 3.ListBoxItem."

Similar presentations


Ads by Google