<Window x:Class="FLY.ControlLibrary.UI.OSK.WdNameKeyboard"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
        mc:Ignorable="d" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:local="clr-namespace:FLY.ControlLibrary.UI.OSK"
        WindowStyle="None" ResizeMode="NoResize" WindowStartupLocation="CenterScreen"
        
        xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
        Height="300" Width="650" Background="#525a65" Loaded="Window_Loaded">

    <Grid>
        <Grid.Resources>
            <SolidColorBrush x:Key="Color_light" Color="#f4f4f4"/>
            <SolidColorBrush x:Key="Color_dark" Color="#8e9aa8"/>
            <Style TargetType="TextBlock" x:Key="TextBlockStyle_abc">
                <Setter Property="FontSize"  Value="20" />
                <Setter Property="FontFamily"  Value="Arial" />
            </Style>
            <Style TargetType="Button" x:Key="ButtonStyle_key">
                <Setter Property="Margin" Value="3"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Button}">
                            <StackPanel Orientation="Vertical">
                                <Border Background="{TemplateBinding Background}" Height="{TemplateBinding ActualHeight}" Width="{TemplateBinding ActualWidth}" BorderThickness="2" CornerRadius="3">
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="50*"/>
                                            <RowDefinition Height="150*"/>
                                            <RowDefinition Height="50*"/>
                                        </Grid.RowDefinitions>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="50*"/>
                                            <ColumnDefinition Width="150*"/>
                                            <ColumnDefinition Width="50*"/>
                                        </Grid.ColumnDefinitions>
                                        <Viewbox Grid.Row="1" Grid.Column="1" >
                                            <ContentPresenter RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                                        </Viewbox>
                                    </Grid>

                                </Border>
                            </StackPanel>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsKeyboardFocused" Value="true">
                                </Trigger>
                                <Trigger Property="IsEnabled" Value="false">
                                </Trigger>
                                <Trigger Property="IsPressed" Value="true">
                                    <Setter Property="Opacity" Value="0.5"/>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>


            <Style TargetType="Button" x:Key="ButtonStyle_abc" BasedOn="{StaticResource ButtonStyle_key}">
                <Setter Property="Background" Value="{StaticResource Color_light}"/>
                <Setter Property="Foreground" Value="#444e57"/>
            </Style>
            <Style TargetType="Button" x:Key="ButtonStyle_opt" BasedOn="{StaticResource ButtonStyle_key}">
                <Setter Property="Background" Value="{StaticResource Color_dark}"/>
                <Setter Property="Foreground" Value="{StaticResource Color_light}"/>
            </Style>
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="57*" />
            <RowDefinition Height="200*" />
        </Grid.RowDefinitions>
        <Border Background="White" Margin="6" CornerRadius="3" MouseDown="Border_MouseDown">
            <Viewbox Margin="3" HorizontalAlignment="Right" VerticalAlignment="Center" >
                <TextBlock x:Name="textblock_result" Text="{Binding ResultView}" Foreground="Black" FontWeight="Bold" FontSize="30" />
            </Viewbox>
        </Border>
        <Grid Grid.Row="1" Margin="3">
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition />
                <RowDefinition />
                <RowDefinition />
                <RowDefinition />
            </Grid.RowDefinitions>
            <Grid Grid.Row="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition  />
                    <ColumnDefinition  />
                    <ColumnDefinition  />
                    <ColumnDefinition  />
                    <ColumnDefinition  />
                    <ColumnDefinition  />
                    <ColumnDefinition  />
                    <ColumnDefinition  />
                    <ColumnDefinition  />
                    <ColumnDefinition  />
                </Grid.ColumnDefinitions>
                <Button Grid.Column="0" Name="button_1" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="1" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="1" Name="button_2" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="2" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="2" Name="button_3" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="3" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="3" Name="button_4" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="4" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="4" Name="button_5" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="5" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="5" Name="button_6" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="6" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="6" Name="button_7" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="7" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="7" Name="button_8" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="8" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="8" Name="button_9" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="9" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="9" Name="button_0" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="0" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>

            </Grid>
            <Grid Grid.Row="1">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition  />
                    <ColumnDefinition  />
                    <ColumnDefinition  />
                    <ColumnDefinition  />
                    <ColumnDefinition  />
                    <ColumnDefinition  />
                    <ColumnDefinition  />
                    <ColumnDefinition  />
                    <ColumnDefinition  />
                    <ColumnDefinition  />
                </Grid.ColumnDefinitions>
                <Button Grid.Column="0" Name="button_q" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="Q" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="1" Name="button_w" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="W" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="2" Name="button_e" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="E" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="3" Name="button_r" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="R" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="4" Name="button_t" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="T" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="5" Name="button_y" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="Y" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="6" Name="button_u" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="U" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="7" Name="button_i" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="I" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="8" Name="button_o" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="O" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="9" Name="button_p" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="P" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
            </Grid>
            <Grid Grid.Row="2">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition  Width="50*"/>
                    <ColumnDefinition  Width="100*"/>
                    <ColumnDefinition  Width="100*"/>
                    <ColumnDefinition  Width="100*"/>
                    <ColumnDefinition  Width="100*"/>
                    <ColumnDefinition  Width="100*"/>
                    <ColumnDefinition  Width="100*"/>
                    <ColumnDefinition  Width="100*"/>
                    <ColumnDefinition  Width="100*"/>
                    <ColumnDefinition  Width="100*"/>
                    <ColumnDefinition  Width="50*"/>

                </Grid.ColumnDefinitions>
                <Button Grid.Column="1" Name="button_a" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="A" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="2" Name="button_s" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="S" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="3" Name="button_d" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="D" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="4" Name="button_f" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="F" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="5" Name="button_g" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="G" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="6" Name="button_h" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="H" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="7" Name="button_j" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="J" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="8" Name="button_k" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="K" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="9" Name="button_l" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="L" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
            </Grid>
            <Grid Grid.Row="3">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition  Width="100*"/>
                    <ColumnDefinition  Width="100*"/>
                    <ColumnDefinition  Width="100*"/>
                    <ColumnDefinition  Width="100*"/>
                    <ColumnDefinition  Width="100*"/>
                    <ColumnDefinition  Width="100*"/>
                    <ColumnDefinition  Width="100*"/>
                    <ColumnDefinition  Width="100*"/>
                    <ColumnDefinition  Width="200*"/>

                </Grid.ColumnDefinitions>

                <Button Grid.Column="1" Name="button_z" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="Z" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="2" Name="button_x" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="X" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="3" Name="button_c" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="C" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="4" Name="button_v" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="V" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="5" Name="button_b" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="B" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="6" Name="button_n" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="N" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="7" Name="button_m" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="M" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="8" Name="button_backspace" Style="{StaticResource ButtonStyle_opt}" Click="button_backspace_Click">
                    <iconPacks:Material Kind="Backspace"  />
                </Button>
            </Grid>
            <Grid Grid.Row="4">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition  Width="250*"/>
                    <ColumnDefinition  Width="300*"/>
                    <ColumnDefinition  Width="100*"/>
                    <ColumnDefinition  Width="100*"/>
                    <ColumnDefinition  Width="100*"/>
                    <ColumnDefinition  Width="100*"/>
                    <ColumnDefinition  Width="250*"/>
                </Grid.ColumnDefinitions>
                <Button Grid.Column="0" Name="button_close" Style="{StaticResource ButtonStyle_opt}" Click="button_close_Click">
                    <iconPacks:Material Kind="KeyboardClose"  />
                </Button>

                <Button Grid.Column="1" Name="button_space" Style="{StaticResource ButtonStyle_abc}" Click="button_space_Click" />
                <Button Grid.Column="2" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="-" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="3" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="#" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="4" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="*" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="5" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="/" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="6" Name="button_enter" Style="{StaticResource ButtonStyle_opt}" Click="button_enter_Click">
                    <iconPacks:Material Kind="KeyboardReturn"  />
                </Button>
            </Grid>
        </Grid>

    </Grid>
</Window>
