FullKeyboard.xaml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. <Window x:Class="MECF.Framework.UI.Client.CenterViews.Dialogs.FullKeyboard"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:local="clr-namespace:MECF.Framework.UI.Client.CenterViews.Dialogs"
  7. mc:Ignorable="d"
  8. Title="FullKeyboard" x:Name="fullKeyboard" AllowsTransparency="True" WindowStyle="None" ResizeMode="NoResize" Background="#7F6F6F6F" Height="270" Width="630" WindowStartupLocation="CenterScreen">
  9. <Window.Resources>
  10. <Style x:Key="btnNum" TargetType="{x:Type Button}">
  11. <!--<Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>-->
  12. <!--<Setter Property="Background">
  13. <Setter.Value>
  14. <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
  15. <GradientStop Color="#F3F3F3" Offset="0"/>
  16. <GradientStop Color="#EBEBEB" Offset="0.5"/>
  17. <GradientStop Color="#DDDDDD" Offset="0.5"/>
  18. <GradientStop Color="#CDCDCD" Offset="1"/>
  19. </LinearGradientBrush>
  20. </Setter.Value>
  21. </Setter>-->
  22. <!--<Setter Property="BorderBrush" Value="#FF707070"/>-->
  23. <!--<Setter Property="BorderThickness" Value="1"/>-->
  24. <!--<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>-->
  25. <Setter Property="Stylus.IsPressAndHoldEnabled" Value="False"/>
  26. <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
  27. <Setter Property="Stylus.IsTouchFeedbackEnabled" Value="False"/>
  28. <Setter Property="HorizontalContentAlignment" Value="Center"/>
  29. <Setter Property="VerticalContentAlignment" Value="Center"/>
  30. <EventSetter Event="PreviewMouseLeftButtonDown" Handler="Button_MouseLeftButtonDown"/>
  31. <EventSetter Event="PreviewTouchDown" Handler="Button_PreviewTouchDown"/>
  32. <!--<Setter Property="Height" Value="64" />
  33. <Setter Property="Width" Value="104" />-->
  34. <!--<Setter Property="Padding" Value="10"/>-->
  35. <Setter Property="Template">
  36. <Setter.Value>
  37. <ControlTemplate TargetType="{x:Type Button}">
  38. <Border x:Name="border" BorderBrush="#FF474747" BorderThickness="1" CornerRadius="6">
  39. <!--<Border.Effect>
  40. <DropShadowEffect BlurRadius="1" ShadowDepth="1" Opacity="0.27"/>
  41. </Border.Effect>-->
  42. <Border.Background>
  43. <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
  44. <GradientStop Color="#FFCCCCCC"/>
  45. <GradientStop Color="WhiteSmoke" Offset="1"/>
  46. </LinearGradientBrush>
  47. </Border.Background>
  48. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" TextElement.Foreground="#FF565656" TextElement.FontSize="14" />
  49. <!--<TextBlock TextWrapping="Wrap" Text="{TemplateBinding Content}" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="21.333" Foreground="#FF565656"/>-->
  50. </Border>
  51. <ControlTemplate.Triggers>
  52. <Trigger Property="IsPressed" Value="True">
  53. <Setter Property="Background" TargetName="border">
  54. <Setter.Value>
  55. <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
  56. <GradientStop Color="#FFFF7500"/>
  57. <GradientStop Color="#FFFFC547" Offset="1"/>
  58. </LinearGradientBrush>
  59. </Setter.Value>
  60. </Setter>
  61. </Trigger>
  62. </ControlTemplate.Triggers>
  63. </ControlTemplate>
  64. </Setter.Value>
  65. </Setter>
  66. </Style>
  67. <Style x:Key="btnFunc" TargetType="{x:Type Button}">
  68. <!--<Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
  69. <Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
  70. <Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
  71. <Setter Property="BorderThickness" Value="1"/>
  72. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>-->
  73. <Setter Property="Stylus.IsPressAndHoldEnabled" Value="False"/>
  74. <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
  75. <Setter Property="Stylus.IsTouchFeedbackEnabled" Value="False"/>
  76. <Setter Property="FontSize" Value="10"/>
  77. <Setter Property="HorizontalContentAlignment" Value="Center"/>
  78. <Setter Property="VerticalContentAlignment" Value="Center"/>
  79. <EventSetter Event="PreviewMouseLeftButtonDown" Handler="Button_MouseLeftButtonDown"/>
  80. <!--<EventSetter Event="PreviewMouseLeftButtonUp" Handler="Button_PreviewMouseLeftButtonUp"/>-->
  81. <EventSetter Event="PreviewTouchUp" Handler="Button_PreviewTouchUp"/>
  82. <!--<Setter Property="Padding" Value="1"/>-->
  83. <Setter Property="Template">
  84. <Setter.Value>
  85. <ControlTemplate TargetType="{x:Type Button}">
  86. <Border x:Name="border" BorderBrush="#FF565656" BorderThickness="1" CornerRadius="6">
  87. <Border.Background>
  88. <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
  89. <GradientStop Color="#FFFFC547" Offset="1"/>
  90. <GradientStop Color="#FFF77202"/>
  91. </LinearGradientBrush>
  92. </Border.Background>
  93. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" TextElement.Foreground="White" TextElement.FontWeight="Bold" TextElement.FontSize="18"/>
  94. <!--<TextBlock TextWrapping="Wrap" Text="{TemplateBinding Content}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" FontSize="21.333"/>-->
  95. </Border>
  96. <ControlTemplate.Triggers>
  97. <Trigger Property="IsPressed" Value="True">
  98. <Setter Property="Background" TargetName="border">
  99. <Setter.Value>
  100. <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
  101. <GradientStop Color="Gray" Offset="1"/>
  102. <GradientStop Color="#FF2D2D2D" Offset="0"/>
  103. </LinearGradientBrush>
  104. </Setter.Value>
  105. </Setter>
  106. </Trigger>
  107. </ControlTemplate.Triggers>
  108. </ControlTemplate>
  109. </Setter.Value>
  110. </Setter>
  111. </Style>
  112. <Style TargetType="{x:Type TextBox}">
  113. <Setter Property="SnapsToDevicePixels" Value="True"/>
  114. <Setter Property="FontFamily" Value="Arial" />
  115. <Setter Property="FontSize" Value="12" />
  116. <Setter Property="BorderThickness" Value="1,1,0,0"/>
  117. <Setter Property="MinHeight" Value="20" />
  118. <Setter Property="Background" Value="{DynamicResource TextBox_BG}" />
  119. <Setter Property="Foreground" Value="Black" />
  120. <Setter Property="BorderBrush" Value="{DynamicResource TextBox_BD}"/>
  121. <Setter Property="Padding" Value="5,1"/>
  122. <Setter Property="HorizontalContentAlignment" Value="Left"/>
  123. <Setter Property="VerticalContentAlignment" Value="Center"/>
  124. <Setter Property="AllowDrop" Value="true"/>
  125. <Setter Property="Stylus.IsPressAndHoldEnabled" Value="False"/>
  126. <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
  127. <Setter Property="Stylus.IsTouchFeedbackEnabled" Value="False"/>
  128. <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
  129. <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
  130. <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
  131. <Setter Property="Template">
  132. <Setter.Value>
  133. <ControlTemplate TargetType="{x:Type TextBox}">
  134. <Grid>
  135. <Border x:Name="TextBox_Outer" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
  136. BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
  137. <Border x:Name="TextBox_Inner" BorderBrush="{DynamicResource TextBox_InnerBD}" BorderThickness="0,0,1,1" Padding="{TemplateBinding Padding}"/>
  138. </Border>
  139. <Rectangle x:Name="Lfet_Boder" Fill="{DynamicResource TextBox_InnerLeft}" HorizontalAlignment="Left" Width="1" Margin="1"/>
  140. <Rectangle x:Name="Top_Boder" Fill="{DynamicResource TextBox_InnerTop}" VerticalAlignment="Top" Height="1" Margin="1"/>
  141. <Rectangle x:Name="Right_Boder" Fill="{DynamicResource TextBox_InnerRight}" HorizontalAlignment="Right" Width="1" Margin="1,2,1,1"/>
  142. <Rectangle x:Name="Bottom_Boder" Fill="{DynamicResource TextBox_InnerBottom}" VerticalAlignment="Bottom" Height="1" Margin="1,1,2,1"/>
  143. <ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
  144. </Grid>
  145. <ControlTemplate.Triggers>
  146. <Trigger Property="IsEnabled" Value="false">
  147. <Setter Property="BorderBrush" TargetName="TextBox_Outer" Value="{DynamicResource TextBox_BD_Unable}"/>
  148. <Setter Property="Background" TargetName="TextBox_Outer" Value="{DynamicResource TextBox_BG_Unable}"/>
  149. <Setter Property="BorderBrush" TargetName="TextBox_Inner" Value="{DynamicResource TextBox_InnerBD_Unable}"/>
  150. <Setter Property="Fill" TargetName="Lfet_Boder" Value="{DynamicResource TextBox_InnerLeft_Unable}"/>
  151. <Setter Property="Fill" TargetName="Top_Boder" Value="{DynamicResource TextBox_InnerTop_Unable}"/>
  152. <Setter Property="Fill" TargetName="Right_Boder" Value="{DynamicResource TextBox_InnerRight_Unable}"/>
  153. <Setter Property="Fill" TargetName="Bottom_Boder" Value="{DynamicResource TextBox_InnerBottom_Unable}"/>
  154. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
  155. </Trigger>
  156. </ControlTemplate.Triggers>
  157. </ControlTemplate>
  158. </Setter.Value>
  159. </Setter>
  160. </Style>
  161. </Window.Resources>
  162. <Window.Triggers>
  163. <EventTrigger SourceName="fullKeyboard" RoutedEvent="Window.Loaded">
  164. <BeginStoryboard>
  165. <Storyboard>
  166. <DoubleAnimation Storyboard.TargetName="fullKeyboard" Storyboard.TargetProperty="Opacity"
  167. From="0" To="1" Duration="0:0:0.2">
  168. </DoubleAnimation>
  169. </Storyboard>
  170. </BeginStoryboard>
  171. </EventTrigger>
  172. </Window.Triggers>
  173. <Border Background="Gray" Width="630" Height="270" CornerRadius="0,0,10,10" BorderThickness="1" BorderBrush="Black">
  174. <Grid>
  175. <Grid.RowDefinitions>
  176. <RowDefinition Height="10"/>
  177. <RowDefinition Height="*"/>
  178. </Grid.RowDefinitions>
  179. <Rectangle Fill="DimGray">
  180. <Rectangle.Effect>
  181. <DropShadowEffect ShadowDepth="0"/>
  182. </Rectangle.Effect>
  183. </Rectangle>
  184. <TextBlock x:Name="FullKeyboardTitle" FontSize="20" Foreground="White" Margin="2" HorizontalAlignment="Left" VerticalAlignment="Center">
  185. </TextBlock>
  186. <Grid Grid.Row="1">
  187. <Grid.RowDefinitions>
  188. <RowDefinition Height="10"/>
  189. <RowDefinition Height="50"/>
  190. <RowDefinition Height="*" />
  191. <RowDefinition Height="10"/>
  192. </Grid.RowDefinitions>
  193. <Grid.ColumnDefinitions>
  194. <ColumnDefinition Width="10"/>
  195. <ColumnDefinition Width="*"/>
  196. <ColumnDefinition Width="10"/>
  197. </Grid.ColumnDefinitions>
  198. <TextBox x:Name="tbValue" Margin="3,3,3,0" FontSize="16" Height="47" Background="Transparent" BorderBrush="Gainsboro" BorderThickness="2" Foreground="White"
  199. Grid.Row="1" Grid.Column="1" Tag="None" IsEnabled="True"
  200. HorizontalContentAlignment="Right" HorizontalAlignment="Stretch" VerticalAlignment="Top" />
  201. <Grid x:Name="ButtonGrid" Grid.Row="2" Grid.Column="1" Margin="0,0,3,0" Grid.RowSpan="2" >
  202. <Grid.RowDefinitions>
  203. <RowDefinition Height="40"/>
  204. <RowDefinition Height="40"/>
  205. <RowDefinition Height="40"/>
  206. <RowDefinition Height="40"/>
  207. <RowDefinition Height="40"/>
  208. </Grid.RowDefinitions>
  209. <Grid.ColumnDefinitions>
  210. <ColumnDefinition Width="60"/>
  211. <ColumnDefinition Width="60"/>
  212. <ColumnDefinition Width="60"/>
  213. <ColumnDefinition Width="60"/>
  214. <ColumnDefinition Width="60"/>
  215. <ColumnDefinition Width="60"/>
  216. <ColumnDefinition Width="60"/>
  217. <ColumnDefinition Width="60"/>
  218. <ColumnDefinition Width="60"/>
  219. <ColumnDefinition Width="60"/>
  220. </Grid.ColumnDefinitions>
  221. <Button Margin="2" Grid.Column="0" Grid.Row="0" Content="1" Style="{StaticResource btnNum}"/>
  222. <Button Margin="2" Grid.Column="1" Grid.Row="0" Content="2" Style="{StaticResource btnNum}"/>
  223. <Button Margin="2" Grid.Column="2" Grid.Row="0" Content="3" Style="{StaticResource btnNum}"/>
  224. <Button Margin="2" Grid.Column="3" Grid.Row="0" Content="4" Style="{StaticResource btnNum}"/>
  225. <Button Margin="2" Grid.Column="4" Grid.Row="0" Content="5" Style="{StaticResource btnNum}"/>
  226. <Button Margin="2" Grid.Column="5" Grid.Row="0" Content="6" Style="{StaticResource btnNum}"/>
  227. <Button Margin="2" Grid.Column="6" Grid.Row="0" Content="7" Style="{StaticResource btnNum}"/>
  228. <Button Margin="2" Grid.Column="7" Grid.Row="0" Content="8" Style="{StaticResource btnNum}"/>
  229. <Button Margin="2" Grid.Column="8" Grid.Row="0" Content="9" Style="{StaticResource btnNum}"/>
  230. <Button Margin="2" Grid.Column="9" Grid.Row="0" Content="0" Style="{StaticResource btnNum}"/>
  231. <Button Margin="2" Grid.Column="0" Grid.Row="1" Content="Q" Style="{StaticResource btnNum}"/>
  232. <Button Margin="2" Grid.Column="1" Grid.Row="1" Content="W" Style="{StaticResource btnNum}"/>
  233. <Button Margin="2" Grid.Column="2" Grid.Row="1" Content="E" Style="{StaticResource btnNum}"/>
  234. <Button Margin="2" Grid.Column="3" Grid.Row="1" Content="R" Style="{StaticResource btnNum}"/>
  235. <Button Margin="2" Grid.Column="4" Grid.Row="1" Content="T" Style="{StaticResource btnNum}"/>
  236. <Button Margin="2" Grid.Column="5" Grid.Row="1" Content="Y" Style="{StaticResource btnNum}"/>
  237. <Button Margin="2" Grid.Column="6" Grid.Row="1" Content="U" Style="{StaticResource btnNum}"/>
  238. <Button Margin="2" Grid.Column="7" Grid.Row="1" Content="I" Style="{StaticResource btnNum}"/>
  239. <Button Margin="2" Grid.Column="8" Grid.Row="1" Content="O" Style="{StaticResource btnNum}"/>
  240. <Button Margin="2" Grid.Column="9" Grid.Row="1" Content="P" Style="{StaticResource btnNum}"/>
  241. <Button Margin="2" Grid.Column="0" Grid.Row="2" Content="A" Style="{StaticResource btnNum}"/>
  242. <Button Margin="2" Grid.Column="1" Grid.Row="2" Content="S" Style="{StaticResource btnNum}"/>
  243. <Button Margin="2" Grid.Column="2" Grid.Row="2" Content="D" Style="{StaticResource btnNum}"/>
  244. <Button Margin="2" Grid.Column="3" Grid.Row="2" Content="F" Style="{StaticResource btnNum}"/>
  245. <Button Margin="2" Grid.Column="4" Grid.Row="2" Content="G" Style="{StaticResource btnNum}"/>
  246. <Button Margin="2" Grid.Column="5" Grid.Row="2" Content="H" Style="{StaticResource btnNum}"/>
  247. <Button Margin="2" Grid.Column="6" Grid.Row="2" Content="J" Style="{StaticResource btnNum}"/>
  248. <Button Margin="2" Grid.Column="7" Grid.Row="2" Content="K" Style="{StaticResource btnNum}"/>
  249. <Button Margin="2" Grid.Column="8" Grid.Row="2" Content="L" Style="{StaticResource btnNum}"/>
  250. <Button Margin="2" Grid.Column="9" Grid.Row="2" Content="-" Style="{StaticResource btnNum}"/>
  251. <Button Margin="2" Grid.Column="0" Grid.Row="3" Content="Z" Style="{StaticResource btnNum}"/>
  252. <Button Margin="2" Grid.Column="1" Grid.Row="3" Content="X" Style="{StaticResource btnNum}"/>
  253. <Button Margin="2" Grid.Column="2" Grid.Row="3" Content="C" Style="{StaticResource btnNum}"/>
  254. <Button Margin="2" Grid.Column="3" Grid.Row="3" Content="V" Style="{StaticResource btnNum}"/>
  255. <Button Margin="2" Grid.Column="4" Grid.Row="3" Content="B" Style="{StaticResource btnNum}"/>
  256. <Button Margin="2" Grid.Column="5" Grid.Row="3" Content="N" Style="{StaticResource btnNum}"/>
  257. <Button Margin="2" Grid.Column="6" Grid.Row="3" Content="M" Style="{StaticResource btnNum}"/>
  258. <Button Margin="2" Grid.Column="7" Grid.Row="3" Content="Space" Style="{StaticResource btnNum}"/>
  259. <Button Margin="2" Grid.Column="8" Grid.Row="3" Content="A/a" Style="{StaticResource btnFunc}"/>
  260. <Button Margin="2" Grid.Column="9" Grid.Row="3" Content="DEL" Style="{StaticResource btnFunc}"/>
  261. <Button Margin="2" Grid.Column="4" Grid.ColumnSpan="2" Grid.Row="4" Content="Clear" Style="{StaticResource btnFunc}"/>
  262. <Button Margin="2" Grid.Column="6" Grid.ColumnSpan="2" Grid.Row="4" Content="Cancel" Style="{StaticResource btnFunc}"/>
  263. <Button Margin="2" Grid.Column="8" Grid.ColumnSpan="2" Grid.Row="4" Content="OK" Style="{StaticResource btnFunc}"/>
  264. </Grid>
  265. </Grid>
  266. </Grid>
  267. </Border>
  268. </Window>