Files
NetUnicodeInfo/UnicodeCharacterInspector/MainWindow.xaml
T
2014-10-25 01:31:36 +02:00

52 lines
2.7 KiB
XML

<Window x:Class="UnicodeCharacterInspector.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:System="clr-namespace:System;assembly=mscorlib"
xmlns:local="clr-namespace:UnicodeCharacterInspector"
mc:Ignorable="d"
TextOptions.TextFormattingMode="Display"
Title="Unicode character inspector"
Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"
Height="350" Width="525">
<Window.DataContext>
<local:CharacterInspectorViewModel />
</Window.DataContext>
<Grid Margin="10">
<Grid.Resources>
<Style TargetType="{x:Type Label}" BasedOn="{StaticResource ResourceKey={x:Type Label}}">
<Setter Property="Margin" Value="3" />
</Style>
<Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource ResourceKey={x:Type TextBox}}">
<Setter Property="Margin" Value="3" />
</Style>
<Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource ResourceKey={x:Type TextBlock}}">
<Setter Property="Margin" Value="3" />
</Style>
<Style TargetType="{x:Type ListBox}" BasedOn="{StaticResource ResourceKey={x:Type ListBox}}">
<Setter Property="Margin" Value="3" />
</Style>
</Grid.Resources>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBox Grid.ColumnSpan="3" MaxLines="1" Text="{Binding Text, UpdateSourceTrigger=PropertyChanged}" />
<ListBox Grid.Row="1" Grid.RowSpan="4" ItemsSource="{Binding Characters}" SelectedIndex="{Binding SelectedCharacterIndex}" />
<TextBlock Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" TextOptions.TextFormattingMode="Ideal" TextOptions.TextRenderingMode="Grayscale" Text="{Binding SelectedCharacterInfo.Character}" FontSize="96" HorizontalAlignment="Center" VerticalAlignment="Center" />
<Label Grid.Row="2" Grid.Column="1" Content="Code point" />
<TextBlock Grid.Row="2" Grid.Column="2" Text="{Binding SelectedCharacterInfo.CodePoint, StringFormat=U+{0:X4}, TargetNullValue={x:Static System:String.Empty}}" VerticalAlignment="Center" />
<Label Grid.Row="3" Grid.Column="1" Content="Category" />
<TextBlock Grid.Row="3" Grid.Column="2" Text="{Binding SelectedCharacterInfo.Category}" VerticalAlignment="Center" />
</Grid>
</Window>