forked from microsoft/WPF-Samples
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMainWindow.xaml
66 lines (66 loc) · 3.46 KB
/
MainWindow.xaml
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<Window x:Class="ThicknessConverter.MainWindow"
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"
xmlns:local="clr-namespace:ThicknessConverter"
mc:Ignorable="d"
Title="MainWindow" SizeToContent="WidthAndHeight">
<DockPanel Width="400" HorizontalAlignment="Left" VerticalAlignment="Top">
<TextBlock DockPanel.Dock="Top" FontFamily="Verdana" FontSize="18" FontWeight="Bold" Margin="5">
ThicknessConverter Sample</TextBlock>
<Border Name="border1" Height="300" Width="300" BorderThickness="2" BorderBrush="Black" DockPanel.Dock="Top">
<Grid Height="30" VerticalAlignment="Top">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Name="bThickness"/>
<TextBlock Grid.Row="1" Name="bColor"/>
</Grid>
</Border>
<Grid DockPanel.Dock="Top">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock TextWrapping="Wrap" Grid.Row="0" FontSize="14" FontWeight="Bold" Grid.ColumnSpan="4" HorizontalAlignment="Center" Margin="0,15,0,15">
Use the ListBoxes below to manipulate the properties of the Border element above.</TextBlock>
<TextBlock Grid.Row="1" Grid.Column="0" Margin="10,0,0,0" TextWrapping="Wrap">Change the BorderThickness Property:</TextBlock>
<ListBox VerticalAlignment="Top" Grid.Column="1" Grid.Row="1" Width="50" Height="50" Margin="5,0,0,0" SelectionChanged="ChangeThickness">
<ListBoxItem>0</ListBoxItem>
<ListBoxItem>5</ListBoxItem>
<ListBoxItem>10</ListBoxItem>
<ListBoxItem>15</ListBoxItem>
<ListBoxItem>20</ListBoxItem>
<ListBoxItem>25</ListBoxItem>
<ListBoxItem>30</ListBoxItem>
<ListBoxItem>35</ListBoxItem>
<ListBoxItem>40</ListBoxItem>
<ListBoxItem>45</ListBoxItem>
<ListBoxItem>50</ListBoxItem>
</ListBox>
<TextBlock Grid.Row="1" Grid.Column="2" TextWrapping="Wrap">Set the BorderBrush Property:</TextBlock>
<ListBox VerticalAlignment="Top" Grid.Column="3" Grid.Row="1" Width="60" Height="50" Margin="5,0,0,0" SelectionChanged="ChangeColor">
<ListBoxItem>Red</ListBoxItem>
<ListBoxItem>Green</ListBoxItem>
<ListBoxItem>Blue</ListBoxItem>
<ListBoxItem>Yellow</ListBoxItem>
<ListBoxItem>Orange</ListBoxItem>
<ListBoxItem>Purple</ListBoxItem>
<ListBoxItem>Silver</ListBoxItem>
<ListBoxItem>Pink</ListBoxItem>
<ListBoxItem>Maroon</ListBoxItem>
<ListBoxItem>Brown</ListBoxItem>
<ListBoxItem>Black</ListBoxItem>
</ListBox>
</Grid>
</DockPanel>
</Window>