<UserControl x:Class="SPC.Kiosk.Common.NumericPad"
             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" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:SPC.Kiosk.Common"
             mc:Ignorable="d" 
             d:DesignHeight="450" 
             d:DesignWidth="400" 
             x:Name="PadBase">
    <UserControl.Resources>
        <local:DoublePercentValue x:Key="HeightToFontSize" />
    </UserControl.Resources>
    <Grid>
        <Grid x:Name="BaseGrid" Width="{Binding Path=Width,ElementName=PadBase}" Height="{Binding Path=Height,ElementName=PadBase}" Background="Transparent">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="1*"/>
                <ColumnDefinition Width="1*"/>
                <ColumnDefinition Width="1*"/>
                <ColumnDefinition Width="1*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="1*"/>
                <RowDefinition Height="2*"/>
                <RowDefinition Height="2*"/>
                <RowDefinition Height="2*"/>
                <RowDefinition Height="2*"/>
            </Grid.RowDefinitions>
            <Grid x:Name="ShowDataGrid" 
                    Grid.Column="0"
                    Grid.Row="0"
                    Grid.ColumnSpan="4"
                    Visibility="{Binding Path=TextVisibility,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                    Background="White">
                <local:MutiLanguageTextBlock x:Name="ShowData" 
                     VerticalAlignment="Center"
                     TextAlignment="Center"
                     Height="{Binding Path=ActualHeight,ElementName=ShowDataGrid}"
                     DisplayLanguage="{Binding Path=DisplayLanguage,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"    
                     GuidText="{Binding Path=GuidText,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                     FontSize="{Binding Path=ActualHeight,ElementName=ShowDataGrid,ConverterParameter=60,Converter={StaticResource HeightToFontSize}}"
                     Foreground="Black"/>
            </Grid>
            <local:AnimationButton x:Name="Button0" 
                                   Grid.Column="3"
                                   Grid.Row="2"
                                   NormalBrush="{Binding Path=NormalBrush,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   DownBrush="{Binding Path=DownBrush,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   BrushStretch="Fill"
                                   ClickAnimationType="{Binding Path=ClickAnimationType,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   TextAlignment="Center"
                                   TextForeground="{Binding Path=TextForeground,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   TextVisible="Visible"
                                   Text="0"
                                   TextFontSize="{Binding ActualHeight,RelativeSource={RelativeSource Self},ConverterParameter=70,Converter={StaticResource HeightToFontSize}}"
                                   />
            <local:AnimationButton x:Name="Button1" 
                                   Grid.Column="0"
                                   Grid.Row="1"
                                   NormalBrush="{Binding Path=NormalBrush,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   DownBrush="{Binding Path=DownBrush,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   BrushStretch="Fill"
                                   ClickAnimationType="{Binding Path=ClickAnimationType,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   TextAlignment="Center"
                                   TextForeground="{Binding Path=TextForeground,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   TextVisible="Visible"
                                   Text="1"
                                   TextFontSize="{Binding ActualHeight,RelativeSource={RelativeSource Self},ConverterParameter=70,Converter={StaticResource HeightToFontSize}}"
                                   />
            <local:AnimationButton x:Name="Button2" 
                                   Grid.Column="1"
                                   Grid.Row="1"
                                   NormalBrush="{Binding Path=NormalBrush,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   DownBrush="{Binding Path=DownBrush,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   BrushStretch="Fill"
                                   ClickAnimationType="{Binding Path=ClickAnimationType,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   TextAlignment="Center"
                                   TextForeground="{Binding Path=TextForeground,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   TextVisible="Visible"
                                   Text="2"
                                   TextFontSize="{Binding ActualHeight,RelativeSource={RelativeSource Self},ConverterParameter=70,Converter={StaticResource HeightToFontSize}}"
                                   />
            <local:AnimationButton x:Name="Button3" 
                                   Grid.Column="2"
                                   Grid.Row="1"
                                   NormalBrush="{Binding Path=NormalBrush,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   DownBrush="{Binding Path=DownBrush,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   BrushStretch="Fill"
                                   ClickAnimationType="{Binding Path=ClickAnimationType,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   TextAlignment="Center"
                                   TextForeground="{Binding Path=TextForeground,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   TextVisible="Visible"
                                   Text="3"
                                   TextFontSize="{Binding ActualHeight,RelativeSource={RelativeSource Self},ConverterParameter=70,Converter={StaticResource HeightToFontSize}}"
                                   />
            <local:AnimationButton x:Name="Button4" 
                                   Grid.Column="0"
                                   Grid.Row="2"
                                   NormalBrush="{Binding Path=NormalBrush,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   DownBrush="{Binding Path=DownBrush,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   BrushStretch="Fill"
                                   ClickAnimationType="{Binding Path=ClickAnimationType,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   TextAlignment="Center"
                                   TextForeground="{Binding Path=TextForeground,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   TextVisible="Visible"
                                   Text="4"
                                   TextFontSize="{Binding ActualHeight,RelativeSource={RelativeSource Self},ConverterParameter=70,Converter={StaticResource HeightToFontSize}}"
                                   />
            <local:AnimationButton x:Name="Button5" 
                                   Grid.Column="1"
                                   Grid.Row="2"
                                   NormalBrush="{Binding Path=NormalBrush,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   DownBrush="{Binding Path=DownBrush,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   BrushStretch="Fill"
                                   ClickAnimationType="{Binding Path=ClickAnimationType,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   TextAlignment="Center"
                                   TextForeground="{Binding Path=TextForeground,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   TextVisible="Visible"
                                   Text="5"
                                   TextFontSize="{Binding ActualHeight,RelativeSource={RelativeSource Self},ConverterParameter=70,Converter={StaticResource HeightToFontSize}}"
                                   />
            <local:AnimationButton x:Name="Button6" 
                                   Grid.Column="2"
                                   Grid.Row="2"
                                   NormalBrush="{Binding Path=NormalBrush,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   DownBrush="{Binding Path=DownBrush,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   BrushStretch="Fill"
                                   ClickAnimationType="{Binding Path=ClickAnimationType,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   TextAlignment="Center"
                                   TextForeground="{Binding Path=TextForeground,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   TextVisible="Visible"
                                   Text="6"
                                   TextFontSize="{Binding ActualHeight,RelativeSource={RelativeSource Self},ConverterParameter=70,Converter={StaticResource HeightToFontSize}}"
                                   />
            <local:AnimationButton x:Name="Button7" 
                                   Grid.Column="0"
                                   Grid.Row="3"
                                   NormalBrush="{Binding Path=NormalBrush,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   DownBrush="{Binding Path=DownBrush,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   BrushStretch="Fill"
                                   ClickAnimationType="{Binding Path=ClickAnimationType,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   TextAlignment="Center"
                                   TextForeground="{Binding Path=TextForeground,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   TextVisible="Visible"
                                   Text="7"
                                   TextFontSize="{Binding ActualHeight,RelativeSource={RelativeSource Self},ConverterParameter=70,Converter={StaticResource HeightToFontSize}}"
                                   />
            <local:AnimationButton x:Name="Button8" 
                                   Grid.Column="1"
                                   Grid.Row="3"
                                   NormalBrush="{Binding Path=NormalBrush,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   DownBrush="{Binding Path=DownBrush,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   BrushStretch="Fill"
                                   ClickAnimationType="{Binding Path=ClickAnimationType,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   TextAlignment="Center"
                                   TextForeground="{Binding Path=TextForeground,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   TextVisible="Visible"
                                   Text="8"
                                   TextFontSize="{Binding ActualHeight,RelativeSource={RelativeSource Self},ConverterParameter=70,Converter={StaticResource HeightToFontSize}}"
                                   />
            <local:AnimationButton x:Name="Button9" 
                                   Grid.Column="2"
                                   Grid.Row="3"
                                   NormalBrush="{Binding Path=NormalBrush,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   DownBrush="{Binding Path=DownBrush,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   BrushStretch="Fill"
                                   ClickAnimationType="{Binding Path=ClickAnimationType,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   TextAlignment="Center"
                                   TextForeground="{Binding Path=TextForeground,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   TextVisible="Visible"
                                   Text="9"
                                   TextFontSize="{Binding ActualHeight,RelativeSource={RelativeSource Self},ConverterParameter=70,Converter={StaticResource HeightToFontSize}}"
                                   />
            <local:AnimationButton x:Name="ButtonEtc" 
                                   Grid.Column="3"
                                   Grid.Row="3"
                                   NormalBrush="{Binding Path=NormalBrush,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   DownBrush="{Binding Path=DownBrush,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   BrushStretch="Fill"
                                   ClickAnimationType="{Binding Path=ClickAnimationType,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   TextAlignment="Center"
                                   TextForeground="{Binding Path=TextForeground,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   TextVisible="Visible"
                                   Text="{Binding Path=EtcText,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   TextFontSize="{Binding ActualHeight,RelativeSource={RelativeSource Self},ConverterParameter=50,Converter={StaticResource HeightToFontSize}}"
                                   />
            <local:AnimationButton x:Name="ButtonBack" 
                                   Grid.Column="3"
                                   Grid.Row="1"
                                   NormalBrush="{Binding Path=CancelNormalBrush,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   DownBrush="{Binding Path=CancelDownBrush,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   BrushStretch="Fill"
                                   ClickAnimationType="{Binding Path=ClickAnimationType,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   TextAlignment="Center"
                                   TextForeground="{Binding Path=CancelForeground,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   TextVisible="Visible"
                                   TextWrapping="Wrap"
                                   Text="←"
                                   TextFontSize="{Binding ActualHeight,RelativeSource={RelativeSource Self},ConverterParameter=50,Converter={StaticResource HeightToFontSize}}"
                                   />
            <local:AnimationButton x:Name="ButtonCancel" 
                                   Grid.Column="0"
                                   Grid.Row="4"
                                   Grid.ColumnSpan="2"
                                   DisplayLanguage="{Binding Path=DisplayLanguage,RelativeSource={RelativeSource AncestorType=local:NumericPad}}" 
                                   NormalBrush="{Binding Path=CancelNormalBrush,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   DownBrush="{Binding Path=CancelDownBrush,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   BrushStretch="Fill"
                                   ClickAnimationType="{Binding Path=ClickAnimationType,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   TextAlignment="Center"
                                   TextForeground="{Binding Path=CancelForeground,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   TextVisible="Visible"
                                   TextWrapping="Wrap"
                                   Text="{Binding Path=CancelText,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   LanguageText="{Binding Path=CancelLanguageText,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   TextFontSize="{Binding ActualHeight,RelativeSource={RelativeSource Self},ConverterParameter=50,Converter={StaticResource HeightToFontSize}}"
                                   />
            <local:AnimationButton x:Name="ButtonOK" 
                                   Grid.Column="2"
                                   Grid.Row="4"
                                   Grid.ColumnSpan="2"
                                   DisplayLanguage="{Binding Path=DisplayLanguage,RelativeSource={RelativeSource AncestorType=local:NumericPad}}" 
                                   NormalBrush="{Binding Path=OkNormalBrush,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   DownBrush="{Binding Path=OkDownBrush,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   DisableBrush="{Binding Path=OkDisableBrush,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   BrushStretch="Fill"
                                   SwitchOnBrush="{Binding Path=OkSwitchOnBrush,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   ClickAnimationType="{Binding Path=ClickAnimationType,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   TextAlignment="Center"
                                   TextForeground="{Binding Path=TextForeground,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   TextVisible="Visible"
                                   Enabled="{Binding Path=OkEnabled,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   Text="{Binding Path=OkText,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   LanguageText="{Binding Path=OkLanguageText,RelativeSource={RelativeSource AncestorType=local:NumericPad}}"
                                   TextFontSize="{Binding ActualHeight,RelativeSource={RelativeSource Self},ConverterParameter=50,Converter={StaticResource HeightToFontSize}}"
                                   />
        </Grid>
    </Grid>
</UserControl>
