-
Notifications
You must be signed in to change notification settings - Fork 10
/
FontDialog.xaml
42 lines (42 loc) · 2.53 KB
/
FontDialog.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
<Window x:Class="NotepadWPF.FontDialog"
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:NotepadWPF"
mc:Ignorable="d"
WindowStyle="SingleBorderWindow"
WindowStartupLocation="CenterOwner"
Title="Font" Height="420" Width="600" ResizeMode="NoResize">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*" />
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="2*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="1*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Label Grid.Row="0" Grid.Column="0" Margin="10,10,0,0">Font</Label>
<Label Grid.Row="0" Grid.Column="1" Margin="10,10,0,0">Font style</Label>
<Label Grid.Row="0" Grid.Column="2" Margin="10,10,0,0">Size</Label>
<ListBox Name="FontList" ItemsSource="{x:Static Fonts.SystemFontFamilies}" Grid.Row="1" Grid.Column="0" Margin="10,0,0,0" SelectionChanged="FontList_SelectionChanged" />
<ListBox Name="FontStyleList" ItemsSource="{Binding}" Grid.Row="1" Grid.Column="1" Margin="10,0,0,0" SelectionChanged="FontStyleList_SelectionChanged" />
<ListBox Name="FontSizeList" ItemsSource="{Binding}" Grid.Row="1" Grid.Column="2" Margin="10,0,10,0" SelectionChanged="FontSizeList_SelectionChanged" />
<StackPanel Grid.Row="1" Grid.Column="3" Orientation="Vertical">
<Button Name="OKButton" Margin="0,0,10,10" Padding="10" Height="Auto" VerticalAlignment="Top" Content="OK" Click="OKButton_Click" />
<Button Name="CancelButton" Margin="0,0,10,10" Padding="10" Height="Auto" VerticalAlignment="Top" Content="Cancel" Click="CancelButton_Click"/>
</StackPanel>
<Label Grid.Row="2" Grid.ColumnSpan="4" Margin="10,10,0,0">Sample</Label>
<Label Name="SampleLabel" Grid.Row="3" Grid.ColumnSpan="4" Padding="10" VerticalAlignment="Top" HorizontalAlignment="Center"
FontFamily="Consolas"
FontStyle="Normal"
FontSize="72"
>AaBbYyZz</Label>
</Grid>
</Window>