<Window x:Class="FLY.ControlLibrary.UI.OSK.WdFullKeyboard"
        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="350" Width="650" Background="#525a65" Loaded="Window_Loaded">
    <Window.Resources>
        <local:FullKeyboardViewModel x:Key="viewModel"/>
    </Window.Resources>
    <Grid d:DataContext="{StaticResource viewModel}">
        <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 Height="50*" />
                <RowDefinition Height="50*" />
                <RowDefinition Height="50*" />
                <RowDefinition Height="50*" />
            </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_q" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="{Binding KeyQ}" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="1" Name="button_w" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="{Binding KeyW}" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="2" Name="button_e" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="{Binding KeyE}" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="3" Name="button_r" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="{Binding KeyR}" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="4" Name="button_t" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="{Binding KeyT}" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="5" Name="button_y" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="{Binding KeyY}" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="6" Name="button_u" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="{Binding KeyU}" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="7" Name="button_i" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="{Binding KeyI}" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="8" Name="button_o" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="{Binding KeyO}" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="9" Name="button_p" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="{Binding KeyP}" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
            </Grid>
            <Grid Grid.Row="1">
                <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="{Binding KeyA}" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="2" Name="button_s" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="{Binding KeyS}" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="3" Name="button_d" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="{Binding KeyD}" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="4" Name="button_f" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="{Binding KeyF}" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="5" Name="button_g" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="{Binding KeyG}" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="6" Name="button_h" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="{Binding KeyH}" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="7" Name="button_j" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="{Binding KeyJ}" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="8" Name="button_k" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="{Binding KeyK}" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="9" Name="button_l" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="{Binding KeyL}" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
            </Grid>
            <Grid Grid.Row="2">
                <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="0" Name="button_caps" Style="{StaticResource ButtonStyle_opt}" Click="button_caps_Click">
                    <iconPacks:Material Kind="KeyboardCaps"  />
                </Button>
                <Button Grid.Column="1" Name="button_z" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="{Binding KeyZ}" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="2" Name="button_x" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="{Binding KeyX}" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="3" Name="button_c" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="{Binding KeyC}" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="4" Name="button_v" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="{Binding KeyV}" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="5" Name="button_b" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="{Binding KeyB}" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="6" Name="button_n" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="{Binding KeyN}" Style="{StaticResource TextBlockStyle_abc}" />
                </Button>
                <Button Grid.Column="7" Name="button_m" Style="{StaticResource ButtonStyle_abc}" Click="button_Click">
                    <TextBlock Text="{Binding KeyM}" 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="3">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition  Width="250*"/>
                    <ColumnDefinition  Width="100*"/>
                    <ColumnDefinition  Width="300*"/>
                    <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_123" Style="{StaticResource ButtonStyle_opt}" Click="button_123_Click">
                    <iconPacks:Material Kind="numeric"  />
                </Button>
                <Button Grid.Column="2" Name="button_space" Style="{StaticResource ButtonStyle_abc}" Click="button_space_Click" />
                <Button Grid.Column="3" Name="button_dot" 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" Name="button_enter" Style="{StaticResource ButtonStyle_opt}" Click="button_enter_Click">
                    <iconPacks:Material Kind="KeyboardReturn"  />
                </Button>
            </Grid>
        </Grid>

    </Grid>
</Window>
