TextBox.xaml 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  1. <ResourceDictionary
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. x:Class=" MECF.Framework.UI.Client.Themes.OceanBlue.TextBoxEx">
  5. <!-- TextBox Style -->
  6. <SolidColorBrush x:Key="TextBox_BD" Color="#FF1B1B1B"/>
  7. <SolidColorBrush x:Key="TextBox_BG" Color="White"/>
  8. <SolidColorBrush x:Key="TextBox_InnerBD" Color="#FFD6D6D6"/>
  9. <SolidColorBrush x:Key="TextBox_InnerLeft" Color="#FF898989"/>
  10. <SolidColorBrush x:Key="TextBox_InnerTop" Color="#FF565656"/>
  11. <SolidColorBrush x:Key="TextBox_InnerRight" Color="#FFD8D8D8"/>
  12. <SolidColorBrush x:Key="TextBox_InnerBottom" Color="#FFE0E0E0"/>
  13. <SolidColorBrush x:Key="TextBox_InnerBD_Unable" Color="#FFBEBDBD"/>
  14. <SolidColorBrush x:Key="TextBox_InnerLeft_Unable" Color="#FFABABAB"/>
  15. <SolidColorBrush x:Key="TextBox_InnerTop_Unable" Color="#FFB4B4B4"/>
  16. <SolidColorBrush x:Key="TextBox_InnerRight_Unable" Color="#FFE7E7E7"/>
  17. <SolidColorBrush x:Key="TextBox_InnerBottom_Unable" Color="#FFE7E7E7"/>
  18. <Style TargetType="{x:Type TextBox}">
  19. <EventSetter Event="PreviewMouseLeftButtonDown" Handler="OnClick"></EventSetter>
  20. <EventSetter Event="PreviewTouchDown" Handler="TextBox_PreviewTouchDown"></EventSetter>
  21. <EventSetter Event="Loaded" Handler="OnLoaded"/>
  22. <Setter Property="SnapsToDevicePixels" Value="True"/>
  23. <Setter Property="FontFamily" Value="Arial" />
  24. <Setter Property="FontSize" Value="12" />
  25. <Setter Property="BorderThickness" Value="1,1,0,0"/>
  26. <Setter Property="MinHeight" Value="20" />
  27. <Setter Property="Background" Value="{DynamicResource TextBox_BG}" />
  28. <Setter Property="Foreground" Value="Black" />
  29. <Setter Property="BorderBrush" Value="{DynamicResource TextBox_BD}"/>
  30. <Setter Property="Padding" Value="5,1"/>
  31. <Setter Property="HorizontalContentAlignment" Value="Left"/>
  32. <Setter Property="VerticalContentAlignment" Value="Center"/>
  33. <Setter Property="AllowDrop" Value="true"/>
  34. <Setter Property="Stylus.IsPressAndHoldEnabled" Value="False"/>
  35. <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
  36. <Setter Property="Stylus.IsTouchFeedbackEnabled" Value="False"/>
  37. <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
  38. <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
  39. <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
  40. <Setter Property="Template">
  41. <Setter.Value>
  42. <ControlTemplate TargetType="{x:Type TextBox}">
  43. <Grid>
  44. <Border x:Name="TextBox_Outer" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
  45. BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
  46. <Border x:Name="TextBox_Inner" BorderBrush="{DynamicResource TextBox_InnerBD}" BorderThickness="0,0,1,1" Padding="{TemplateBinding Padding}"/>
  47. </Border>
  48. <Rectangle x:Name="Lfet_Boder" Fill="{DynamicResource TextBox_InnerLeft}" HorizontalAlignment="Left" Width="1" Margin="1"/>
  49. <Rectangle x:Name="Top_Boder" Fill="{DynamicResource TextBox_InnerTop}" VerticalAlignment="Top" Height="1" Margin="1"/>
  50. <Rectangle x:Name="Right_Boder" Fill="{DynamicResource TextBox_InnerRight}" HorizontalAlignment="Right" Width="1" Margin="1,2,1,1"/>
  51. <Rectangle x:Name="Bottom_Boder" Fill="{DynamicResource TextBox_InnerBottom}" VerticalAlignment="Bottom" Height="1" Margin="1,1,2,1"/>
  52. <ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
  53. </Grid>
  54. <ControlTemplate.Triggers>
  55. <Trigger Property="IsEnabled" Value="false">
  56. <Setter Property="BorderBrush" TargetName="TextBox_Outer" Value="{DynamicResource TextBox_BD_Unable}"/>
  57. <Setter Property="Background" TargetName="TextBox_Outer" Value="{DynamicResource TextBox_BG_Unable}"/>
  58. <Setter Property="BorderBrush" TargetName="TextBox_Inner" Value="{DynamicResource TextBox_InnerBD_Unable}"/>
  59. <Setter Property="Fill" TargetName="Lfet_Boder" Value="{DynamicResource TextBox_InnerLeft_Unable}"/>
  60. <Setter Property="Fill" TargetName="Top_Boder" Value="{DynamicResource TextBox_InnerTop_Unable}"/>
  61. <Setter Property="Fill" TargetName="Right_Boder" Value="{DynamicResource TextBox_InnerRight_Unable}"/>
  62. <Setter Property="Fill" TargetName="Bottom_Boder" Value="{DynamicResource TextBox_InnerBottom_Unable}"/>
  63. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
  64. </Trigger>
  65. </ControlTemplate.Triggers>
  66. </ControlTemplate>
  67. </Setter.Value>
  68. </Setter>
  69. </Style>
  70. <Style x:Key="TextBox_NoClik" TargetType="{x:Type TextBox}">
  71. <Setter Property="SnapsToDevicePixels" Value="True"/>
  72. <Setter Property="FontFamily" Value="Arial" />
  73. <Setter Property="FontSize" Value="12" />
  74. <Setter Property="BorderThickness" Value="1,1,0,0"/>
  75. <Setter Property="MinHeight" Value="20" />
  76. <Setter Property="Background" Value="{DynamicResource TextBox_BG}" />
  77. <Setter Property="Foreground" Value="Black" />
  78. <Setter Property="BorderBrush" Value="{DynamicResource TextBox_BD}"/>
  79. <Setter Property="Padding" Value="5,1"/>
  80. <Setter Property="HorizontalContentAlignment" Value="Left"/>
  81. <Setter Property="VerticalContentAlignment" Value="Center"/>
  82. <Setter Property="AllowDrop" Value="true"/>
  83. <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
  84. <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
  85. <Setter Property="Stylus.IsPressAndHoldEnabled" Value="False"/>
  86. <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
  87. <Setter Property="Stylus.IsTouchFeedbackEnabled" Value="False"/>
  88. <Setter Property="Template">
  89. <Setter.Value>
  90. <ControlTemplate TargetType="{x:Type TextBox}">
  91. <Grid>
  92. <Border x:Name="TextBox_Outer" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
  93. BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
  94. <Border x:Name="TextBox_Inner" BorderBrush="{DynamicResource TextBox_InnerBD}" BorderThickness="0,0,1,1" Padding="{TemplateBinding Padding}"/>
  95. </Border>
  96. <Rectangle x:Name="Lfet_Boder" Fill="{DynamicResource TextBox_InnerLeft}" HorizontalAlignment="Left" Width="1" Margin="1"/>
  97. <Rectangle x:Name="Top_Boder" Fill="{DynamicResource TextBox_InnerTop}" VerticalAlignment="Top" Height="1" Margin="1"/>
  98. <Rectangle x:Name="Right_Boder" Fill="{DynamicResource TextBox_InnerRight}" HorizontalAlignment="Right" Width="1" Margin="1,2,1,1"/>
  99. <Rectangle x:Name="Bottom_Boder" Fill="{DynamicResource TextBox_InnerBottom}" VerticalAlignment="Bottom" Height="1" Margin="1,1,2,1"/>
  100. <ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
  101. </Grid>
  102. <ControlTemplate.Triggers>
  103. <Trigger Property="IsEnabled" Value="false">
  104. <Setter Property="BorderBrush" TargetName="TextBox_Outer" Value="{DynamicResource TextBox_BD_Unable}"/>
  105. <Setter Property="Background" TargetName="TextBox_Outer" Value="{DynamicResource TextBox_BG_Unable}"/>
  106. <Setter Property="BorderBrush" TargetName="TextBox_Inner" Value="{DynamicResource TextBox_InnerBD_Unable}"/>
  107. <Setter Property="Fill" TargetName="Lfet_Boder" Value="{DynamicResource TextBox_InnerLeft_Unable}"/>
  108. <Setter Property="Fill" TargetName="Top_Boder" Value="{DynamicResource TextBox_InnerTop_Unable}"/>
  109. <Setter Property="Fill" TargetName="Right_Boder" Value="{DynamicResource TextBox_InnerRight_Unable}"/>
  110. <Setter Property="Fill" TargetName="Bottom_Boder" Value="{DynamicResource TextBox_InnerBottom_Unable}"/>
  111. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
  112. </Trigger>
  113. </ControlTemplate.Triggers>
  114. </ControlTemplate>
  115. </Setter.Value>
  116. </Setter>
  117. </Style>
  118. <Style TargetType="{x:Type PasswordBox}">
  119. <Setter Property="Background" Value="{DynamicResource TextBox_BG}" />
  120. <Setter Property="Foreground" Value="Black" />
  121. <Setter Property="BorderBrush" Value="{DynamicResource TextBox_BD}"/>
  122. <Setter Property="FontFamily" Value="Times New Roman"/>
  123. <Setter Property="PasswordChar" Value="●"/>
  124. <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
  125. <Setter Property="BorderThickness" Value="1"/>
  126. <Setter Property="HorizontalContentAlignment" Value="Left"/>
  127. <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
  128. <Setter Property="AllowDrop" Value="true"/>
  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 PasswordBox}">
  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="Center"/>
  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. <ControlTemplate x:Key="ValidationTemplate">
  162. <DockPanel>
  163. <Border BorderBrush="Red" BorderThickness="1">
  164. <AdornedElementPlaceholder/>
  165. </Border>
  166. <TextBlock Foreground="Red" FontSize="20">*</TextBlock>
  167. </DockPanel>
  168. </ControlTemplate>
  169. <!-- TextBox_Top Style -->
  170. <SolidColorBrush x:Key="TextBox_Top_BG" Color="#FFC8E8FF"/>
  171. <SolidColorBrush x:Key="TextBox_Top_Shadow" Color="#FF1B1B1B"/>
  172. <SolidColorBrush x:Key="TextBox_Top_Highlight_Right" Color="#B2AFC2D3"/>
  173. <SolidColorBrush x:Key="TextBox_Top_Highlight_Bottom" Color="#FFD2D2D2"/>
  174. <Style x:Key="TextBox_Top" TargetType="{x:Type TextBox}">
  175. <Setter Property="SnapsToDevicePixels" Value="True"/>
  176. <Setter Property="FontFamily" Value="Arial" />
  177. <Setter Property="FontSize" Value="14" />
  178. <Setter Property="Margin" Value="0,2,2,2"/>
  179. <Setter Property="BorderThickness" Value="0,1,1,1"/>
  180. <Setter Property="Background" Value="{DynamicResource TextBox_Top_BG}" />
  181. <Setter Property="Foreground" Value="{DynamicResource Foreground_Black}" />
  182. <Setter Property="BorderBrush" Value="{DynamicResource TextBox_Top_Highlight_Right}"/>
  183. <Setter Property="Border.CornerRadius" Value="0,6,6,0"/>
  184. <Setter Property="HorizontalAlignment" Value="Stretch"/>
  185. <Setter Property="VerticalAlignment" Value="Stretch"/>
  186. <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
  187. <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
  188. <Setter Property="Stylus.IsPressAndHoldEnabled" Value="False"/>
  189. <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
  190. <Setter Property="Stylus.IsTouchFeedbackEnabled" Value="False"/>
  191. <Setter Property="Template">
  192. <Setter.Value>
  193. <ControlTemplate TargetType="{x:Type TextBox}">
  194. <Grid>
  195. <Border x:Name="TextBox_Bg" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" CornerRadius="{TemplateBinding Border.CornerRadius}"
  196. BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
  197. <ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="5,1" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
  198. </Border>
  199. </Grid>
  200. <ControlTemplate.Triggers>
  201. <Trigger Property="IsEnabled" Value="false">
  202. <Setter Property="Background" TargetName="TextBox_Bg" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
  203. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
  204. </Trigger>
  205. </ControlTemplate.Triggers>
  206. </ControlTemplate>
  207. </Setter.Value>
  208. </Setter>
  209. </Style>
  210. <Style x:Key="TextBox_RightTop" TargetType="{x:Type TextBox}" BasedOn="{StaticResource TextBox_Top}"/>
  211. <!-- Login TextBox -->
  212. <SolidColorBrush x:Key="TextBox_Login_BG" Color="#FF1E4F8A"/>
  213. <SolidColorBrush x:Key="TextBox_Login_BD" Color="#FF0A2B58"/>
  214. <SolidColorBrush x:Key="TextBox_BG_Unable" Color="Gainsboro"/>
  215. <SolidColorBrush x:Key="TextBox_BD_Unable" Color="#FF747474"/>
  216. <Style x:Key="Login_TextBox" TargetType="{x:Type TextBox}">
  217. <EventSetter Event="PreviewMouseLeftButtonDown" Handler="OnClick"></EventSetter>
  218. <EventSetter Event="PreviewTouchDown" Handler="TextBox_PreviewTouchDown"></EventSetter>
  219. <EventSetter Event="Loaded" Handler="OnLoaded"/>
  220. <Setter Property="SnapsToDevicePixels" Value="True"/>
  221. <Setter Property="FontFamily" Value="Arial" />
  222. <Setter Property="FontSize" Value="14" />
  223. <Setter Property="BorderThickness" Value="2"/>
  224. <Setter Property="MinHeight" Value="20" />
  225. <Setter Property="Background" Value="{StaticResource TextBox_Login_BG}"/>
  226. <Setter Property="Foreground" Value="{DynamicResource FG_White}" />
  227. <Setter Property="BorderBrush" Value="{StaticResource TextBox_Login_BD}"/>
  228. <Setter Property="Padding" Value="5,1"/>
  229. <Setter Property="HorizontalContentAlignment" Value="Left"/>
  230. <Setter Property="VerticalContentAlignment" Value="Center"/>
  231. <Setter Property="AllowDrop" Value="true"/>
  232. <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
  233. <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
  234. <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
  235. <Setter Property="Template">
  236. <Setter.Value>
  237. <ControlTemplate TargetType="{x:Type TextBox}">
  238. <Border x:Name="BG" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
  239. <ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
  240. </Border>
  241. <ControlTemplate.Triggers>
  242. <Trigger Property="IsEnabled" Value="false">
  243. <Setter Property="BorderBrush" TargetName="BG" Value="{StaticResource TextBox_BD_Unable}"/>
  244. <Setter Property="Background" TargetName="BG" Value="{StaticResource TextBox_BG_Unable}"/>
  245. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
  246. </Trigger>
  247. </ControlTemplate.Triggers>
  248. </ControlTemplate>
  249. </Setter.Value>
  250. </Setter>
  251. </Style>
  252. <Style x:Key="Err_TextBox" TargetType="{x:Type TextBox}">
  253. <EventSetter Event="PreviewMouseLeftButtonDown" Handler="OnClick"></EventSetter>
  254. <EventSetter Event="PreviewTouchDown" Handler="TextBox_PreviewTouchDown"></EventSetter>
  255. <EventSetter Event="Loaded" Handler="OnLoaded"/>
  256. <Setter Property="SnapsToDevicePixels" Value="True"/>
  257. <Setter Property="FontFamily" Value="Arial" />
  258. <Setter Property="FontSize" Value="14" />
  259. <Setter Property="BorderThickness" Value="2"/>
  260. <Setter Property="MinHeight" Value="20" />
  261. <Setter Property="Padding" Value="5,1"/>
  262. <Setter Property="HorizontalContentAlignment" Value="Left"/>
  263. <Setter Property="VerticalContentAlignment" Value="Center"/>
  264. <Setter Property="AllowDrop" Value="true"/>
  265. <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
  266. <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
  267. <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
  268. <Setter Property="Template">
  269. <Setter.Value>
  270. <ControlTemplate TargetType="{x:Type TextBox}">
  271. <Border x:Name="BG" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
  272. <ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
  273. </Border>
  274. <ControlTemplate.Triggers>
  275. <Trigger Property="IsEnabled" Value="false">
  276. <Setter Property="BorderBrush" TargetName="BG" Value="{StaticResource TextBox_BD_Unable}"/>
  277. <Setter Property="Background" TargetName="BG" Value="{StaticResource TextBox_BG_Unable}"/>
  278. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
  279. </Trigger>
  280. </ControlTemplate.Triggers>
  281. </ControlTemplate>
  282. </Setter.Value>
  283. </Setter>
  284. </Style>
  285. <Style x:Key="Login_PasswordBox" TargetType="{x:Type PasswordBox}">
  286. <EventSetter Event="PreviewMouseLeftButtonDown" Handler="OnClick"></EventSetter>
  287. <EventSetter Event="PreviewTouchDown" Handler="TextBox_PreviewTouchDown"></EventSetter>
  288. <EventSetter Event="Loaded" Handler="OnLoaded"/>
  289. <Setter Property="Background" Value="{StaticResource TextBox_Login_BG}"/>
  290. <Setter Property="Foreground" Value="{DynamicResource FG_White}" />
  291. <Setter Property="BorderBrush" Value="{StaticResource TextBox_Login_BD}"/>
  292. <Setter Property="SnapsToDevicePixels" Value="True"/>
  293. <Setter Property="FontFamily" Value="Arial" />
  294. <Setter Property="PasswordChar" Value="●"/>
  295. <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
  296. <Setter Property="BorderThickness" Value="2"/>
  297. <Setter Property="HorizontalContentAlignment" Value="Left"/>
  298. <Setter Property="VerticalContentAlignment" Value="Center"/>
  299. <Setter Property="Padding" Value="5,1"/>
  300. <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
  301. <Setter Property="AllowDrop" Value="true"/>
  302. <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
  303. <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
  304. <Setter Property="Template">
  305. <Setter.Value>
  306. <ControlTemplate TargetType="{x:Type PasswordBox}">
  307. <Border x:Name="BG" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
  308. <ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
  309. </Border>
  310. <ControlTemplate.Triggers>
  311. <Trigger Property="IsEnabled" Value="false">
  312. <Setter Property="BorderBrush" TargetName="BG" Value="{StaticResource TextBox_BD_Unable}"/>
  313. <Setter Property="Background" TargetName="BG" Value="{StaticResource TextBox_BG_Unable}"/>
  314. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
  315. </Trigger>
  316. </ControlTemplate.Triggers>
  317. </ControlTemplate>
  318. </Setter.Value>
  319. </Setter>
  320. </Style>
  321. </ResourceDictionary>