NumberKeyboard.xaml 8.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <UserControl x:Class="HistoryView.Controls.Input.NumberKeyboard"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:HistoryView.Controls.Input"
  7. mc:Ignorable="d"
  8. x:Name="This"
  9. d:DesignHeight="450" d:DesignWidth="800">
  10. <Grid>
  11. <ContentPresenter x:Name="presenter" TouchEnter="presenter_TouchEnter"
  12. TouchLeave="presenter_TouchLeave" Content="{Binding ElementName=This, Path=DisplayContent}"/>
  13. <Popup x:Name="PopKeyboard" AllowsTransparency="True" PopupAnimation="Slide" PlacementTarget="{Binding ElementName=presenter}" HorizontalOffset="-56" VerticalOffset="5">
  14. <Border BorderBrush="{StaticResource DarkBorderColor}" BorderThickness="2" CornerRadius="8" Background="{StaticResource BackgroundColor}">
  15. <Grid>
  16. <Grid.RowDefinitions>
  17. <RowDefinition Height="auto"/>
  18. <RowDefinition Height="8"/>
  19. <RowDefinition/>
  20. </Grid.RowDefinitions>
  21. <Border Background="{StaticResource LightThemeColor}" CornerRadius="8,8,0,0" >
  22. <StackPanel Margin="8" Orientation="Horizontal" HorizontalAlignment="Center">
  23. <TextBlock Foreground="Red" FontSize="16" FontWeight="Bold" VerticalAlignment="Center">|</TextBlock>
  24. <TextBlock FontSize="14" VerticalAlignment="Center" Text="{Binding ElementName=This, Path=Display}"/>
  25. <TextBlock Foreground="Red" FontSize="16" FontWeight="Bold" VerticalAlignment="Center">|</TextBlock>
  26. </StackPanel>
  27. </Border>
  28. <Grid Grid.Row="2" Margin="8" TextElement.FontSize="16" TextElement.FontWeight="Bold">
  29. <Grid.ColumnDefinitions>
  30. <ColumnDefinition Width="42"/>
  31. <ColumnDefinition Width="8"/>
  32. <ColumnDefinition Width="42"/>
  33. <ColumnDefinition Width="8"/>
  34. <ColumnDefinition Width="42"/>
  35. <ColumnDefinition Width="8"/>
  36. <ColumnDefinition Width="42"/>
  37. </Grid.ColumnDefinitions>
  38. <Grid.RowDefinitions>
  39. <RowDefinition Height="42"/>
  40. <RowDefinition Height="8"/>
  41. <RowDefinition Height="42"/>
  42. <RowDefinition Height="8"/>
  43. <RowDefinition Height="42"/>
  44. <RowDefinition Height="8"/>
  45. <RowDefinition Height="42"/>
  46. <RowDefinition Height="8"/>
  47. <RowDefinition Height="42"/>
  48. </Grid.RowDefinitions>
  49. <Button Grid.Column="0" Grid.Row="0" Style="{StaticResource FunctionButton}" Background="{StaticResource NormalColor}" Click="Operate" TouchDown="Button_TouchDown" TouchLeave="Button_TouchLeave" CommandParameter="+1">+1</Button>
  50. <Button Grid.Column="2" Grid.Row="0" Style="{StaticResource FunctionButton}" Background="{StaticResource NormalColor}" Click="Operate" TouchDown="Button_TouchDown" TouchLeave="Button_TouchLeave" CommandParameter="+.1" FontSize="12">+.1</Button>
  51. <Button Grid.Column="4" Grid.Row="0" Style="{StaticResource FunctionButton}" Background="{StaticResource NormalColor}" Click="Operate" TouchDown="Button_TouchDown" TouchLeave="Button_TouchLeave" CommandParameter="-.1" FontSize="12">-.1</Button>
  52. <Button Grid.Column="6" Grid.Row="0" Style="{StaticResource FunctionButton}" Background="{StaticResource NormalColor}" Click="Operate" TouchDown="Button_TouchDown" TouchLeave="Button_TouchLeave" CommandParameter="-1">-1</Button>
  53. <Button Grid.Column="0" Grid.Row="2" Style="{StaticResource FunctionButton}" Background="{StaticResource ThemeColor}" Click="SendKey" TouchDown="Button_TouchDown" TouchLeave="Button_TouchLeave" CommandParameter="1">1</Button>
  54. <Button Grid.Column="2" Grid.Row="2" Style="{StaticResource FunctionButton}" Background="{StaticResource ThemeColor}" Click="SendKey" TouchDown="Button_TouchDown" TouchLeave="Button_TouchLeave" CommandParameter="2">2</Button>
  55. <Button Grid.Column="4" Grid.Row="2" Style="{StaticResource FunctionButton}" Background="{StaticResource ThemeColor}" Click="SendKey" TouchDown="Button_TouchDown" TouchLeave="Button_TouchLeave" CommandParameter="3">3</Button>
  56. <Button Grid.Column="0" Grid.Row="4" Style="{StaticResource FunctionButton}" Background="{StaticResource ThemeColor}" Click="SendKey" TouchDown="Button_TouchDown" TouchLeave="Button_TouchLeave" CommandParameter="4">4</Button>
  57. <Button Grid.Column="2" Grid.Row="4" Style="{StaticResource FunctionButton}" Background="{StaticResource ThemeColor}" Click="SendKey" TouchDown="Button_TouchDown" TouchLeave="Button_TouchLeave" CommandParameter="5">5</Button>
  58. <Button Grid.Column="4" Grid.Row="4" Style="{StaticResource FunctionButton}" Background="{StaticResource ThemeColor}" Click="SendKey" TouchDown="Button_TouchDown" TouchLeave="Button_TouchLeave" CommandParameter="6">6</Button>
  59. <Button Grid.Column="0" Grid.Row="6" Style="{StaticResource FunctionButton}" Background="{StaticResource ThemeColor}" Click="SendKey" TouchDown="Button_TouchDown" TouchLeave="Button_TouchLeave" CommandParameter="7">7</Button>
  60. <Button Grid.Column="2" Grid.Row="6" Style="{StaticResource FunctionButton}" Background="{StaticResource ThemeColor}" Click="SendKey" TouchDown="Button_TouchDown" TouchLeave="Button_TouchLeave" CommandParameter="8">8</Button>
  61. <Button Grid.Column="4" Grid.Row="6" Style="{StaticResource FunctionButton}" Background="{StaticResource ThemeColor}" Click="SendKey" TouchDown="Button_TouchDown" TouchLeave="Button_TouchLeave" CommandParameter="9">9</Button>
  62. <Button Grid.Column="0" Grid.Row="8" Grid.ColumnSpan="3" Style="{StaticResource FunctionButton}" Background="{StaticResource ThemeColor}" TouchDown="Button_TouchDown" TouchLeave="Button_TouchLeave" Click="SendKey" CommandParameter="0">0</Button>
  63. <Button Grid.Column="4" Grid.Row="8" Style="{StaticResource FunctionButton}" Click="SendKey" TouchDown="Button_TouchDown" TouchLeave="Button_TouchLeave" CommandParameter=".">.</Button>
  64. <Button Grid.Column="6" Grid.Row="2" Style="{StaticResource FunctionButton}" Background="{StaticResource WarningColor}" Click="Delete" FontSize="11">Del</Button>
  65. <Button Grid.Column="6" Grid.Row="4" Style="{StaticResource FunctionButton}" Background="{StaticResource WarningColor}" Click="Clear">C</Button>
  66. <Button Grid.Column="6" Grid.Row="6" Style="{StaticResource FunctionButton}" Click="CancelConfirm" CommandParameter="Cancel" Background="{StaticResource EmergencyColor}">×</Button>
  67. <Button Grid.Column="6" Grid.Row="8" Style="{StaticResource FunctionButton}" Click="CancelConfirm" CommandParameter="Confirm" Background="{StaticResource NiceGreen}">√</Button>
  68. </Grid>
  69. </Grid>
  70. </Border>
  71. </Popup>
  72. <Popup x:Name="Hint" Placement="Top" VerticalOffset="-16" AllowsTransparency="True">
  73. <Border Background="White" Width="50" Height="50" CornerRadius="8">
  74. <TextBlock x:Name="HintText" FontSize="24" VerticalAlignment="Center" HorizontalAlignment="Center" FontWeight="Bold" Foreground="Black"/>
  75. </Border>
  76. </Popup>
  77. </Grid>
  78. </UserControl>