TextBlockStyle.xaml 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008">
  5. <!--
  6. <Style x:Key="TextBoxStyle1" TargetType="{x:Type TextBox}">
  7. <Setter Property="BorderBrush" Value="{DynamicResource MuchinfoBrush22}" />
  8. <Setter Property="BorderThickness" Value="1" />
  9. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}" />
  10. <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" />
  11. <Setter Property="Padding" Value="1" />
  12. <Setter Property="KeyboardNavigation.TabNavigation" Value="None" />
  13. <Setter Property="HorizontalContentAlignment" Value="Left" />
  14. <Setter Property="VerticalContentAlignment" Value="Bottom" />
  15. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  16. <Setter Property="AllowDrop" Value="True" />
  17. <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst" />
  18. <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
  19. <Setter Property="Template">
  20. <Setter.Value>
  21. <ControlTemplate TargetType="{x:Type TextBox}">
  22. <Themes:ClassicBorderDecorator x:Name="Bd"
  23. Background="{TemplateBinding Background}"
  24. BorderBrush="{TemplateBinding BorderBrush}"
  25. BorderStyle="None"
  26. BorderThickness="{TemplateBinding BorderThickness}"
  27. UseLayoutRounding="True"
  28. d:DesignUseLayoutRounding="True">
  29. <ScrollViewer x:Name="PART_ContentHost"
  30. UseLayoutRounding="True"
  31. d:DesignUseLayoutRounding="True" />
  32. </Themes:ClassicBorderDecorator>
  33. <ControlTemplate.Triggers>
  34. <Trigger Property="IsEnabled" Value="False">
  35. <Setter TargetName="Bd" Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" />
  36. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
  37. </Trigger>
  38. </ControlTemplate.Triggers>
  39. </ControlTemplate>
  40. </Setter.Value>
  41. </Setter>
  42. </Style>
  43. -->
  44. <!--
  45. <Style TargetType="{x:Type TextBox}">
  46. <Setter Property="BorderBrush" Value="{DynamicResource MuchinfoBrush22}" />
  47. <Setter Property="BorderThickness" Value="1" />
  48. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}" />
  49. <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" />
  50. <Setter Property="Padding" Value="1" />
  51. <Setter Property="KeyboardNavigation.TabNavigation" Value="None" />
  52. <Setter Property="HorizontalContentAlignment" Value="Left" />
  53. <Setter Property="VerticalContentAlignment" Value="Bottom" />
  54. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  55. <Setter Property="AllowDrop" Value="true" />
  56. <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst" />
  57. <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
  58. <Setter Property="Template">
  59. <Setter.Value>
  60. <ControlTemplate TargetType="{x:Type TextBox}">
  61. <themes:ClassicBorderDecorator x:Name="Bd"
  62. Background="{TemplateBinding Background}"
  63. BorderBrush="{TemplateBinding BorderBrush}"
  64. BorderStyle="None"
  65. BorderThickness="{TemplateBinding BorderThickness}">
  66. <ScrollViewer x:Name="PART_ContentHost" />
  67. </themes:ClassicBorderDecorator>
  68. <ControlTemplate.Triggers>
  69. <Trigger Property="IsEnabled" Value="false">
  70. <Setter TargetName="Bd" Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" />
  71. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
  72. </Trigger>
  73. </ControlTemplate.Triggers>
  74. </ControlTemplate>
  75. </Setter.Value>
  76. </Setter>
  77. </Style>
  78. -->
  79. <Style x:Key="CommonTextBoxStyle" TargetType="{x:Type TextBox}">
  80. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  81. <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" />
  82. <Setter Property="BorderBrush" Value="{DynamicResource MuchinfoBrush22}" />
  83. <Setter Property="VerticalContentAlignment" Value="Center" />
  84. <Setter Property="VerticalAlignment" Value="Center" />
  85. <Setter Property="BorderThickness" Value="1" />
  86. <Setter Property="Padding" Value="0" />
  87. <Setter Property="AllowDrop" Value="true" />
  88. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  89. <Setter Property="Template">
  90. <Setter.Value>
  91. <ControlTemplate TargetType="{x:Type TextBox}">
  92. <Themes:ListBoxChrome x:Name="Bd"
  93. Background="{TemplateBinding Background}"
  94. BorderBrush="{TemplateBinding BorderBrush}"
  95. BorderThickness="{TemplateBinding BorderThickness}"
  96. RenderFocused="{TemplateBinding IsKeyboardFocusWithin}"
  97. RenderMouseOver="{TemplateBinding IsMouseOver}"
  98. SnapsToDevicePixels="true">
  99. <ScrollViewer x:Name="PART_ContentHost"
  100. VerticalAlignment="{TemplateBinding VerticalAlignment}"
  101. VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
  102. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  103. </Themes:ListBoxChrome>
  104. <ControlTemplate.Triggers>
  105. <Trigger Property="IsEnabled" Value="False">
  106. <Setter TargetName="Bd" Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" />
  107. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
  108. <Setter Property="BorderThickness" Value="1" />
  109. </Trigger>
  110. </ControlTemplate.Triggers>
  111. </ControlTemplate>
  112. </Setter.Value>
  113. </Setter>
  114. </Style>
  115. <Style BasedOn="{StaticResource CommonTextBoxStyle}" TargetType="{x:Type TextBox}" />
  116. <Style x:Key="ComboBoxFocusVisual">
  117. <Setter Property="Control.Template">
  118. <Setter.Value>
  119. <ControlTemplate>
  120. <Rectangle Margin="4,4,21,4"
  121. SnapsToDevicePixels="true"
  122. Stroke="Black"
  123. StrokeDashArray="1 2"
  124. StrokeThickness="1" />
  125. </ControlTemplate>
  126. </Setter.Value>
  127. </Setter>
  128. </Style>
  129. <LinearGradientBrush x:Key="ButtonNormalBackground" StartPoint="0,0" EndPoint="0,1">
  130. <GradientStop Offset="0" Color="#F3F3F3" />
  131. <GradientStop Offset="0.5" Color="#EBEBEB" />
  132. <GradientStop Offset="0.5" Color="#DDDDDD" />
  133. <GradientStop Offset="1" Color="#CDCDCD" />
  134. </LinearGradientBrush>
  135. <SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070" />
  136. <Geometry x:Key="DownArrowGeometry">M 0 0 L 3.5 4 L 7 0 Z</Geometry>
  137. <Style x:Key="ComboBoxReadonlyToggleButton" TargetType="{x:Type ToggleButton}">
  138. <Setter Property="OverridesDefaultStyle" Value="true" />
  139. <Setter Property="IsTabStop" Value="false" />
  140. <Setter Property="Focusable" Value="false" />
  141. <Setter Property="ClickMode" Value="Press" />
  142. <Setter Property="Template">
  143. <Setter.Value>
  144. <ControlTemplate TargetType="{x:Type ToggleButton}">
  145. <Themes:ButtonChrome x:Name="Chrome"
  146. Background="{TemplateBinding Background}"
  147. BorderBrush="{TemplateBinding BorderBrush}"
  148. RenderMouseOver="{TemplateBinding IsMouseOver}"
  149. RenderPressed="{TemplateBinding IsPressed}"
  150. SnapsToDevicePixels="true">
  151. <Grid Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" HorizontalAlignment="Right">
  152. <Path x:Name="Arrow"
  153. Margin="3,1,0,0"
  154. HorizontalAlignment="Center"
  155. VerticalAlignment="Center"
  156. Data="{StaticResource DownArrowGeometry}"
  157. Fill="Black" />
  158. </Grid>
  159. </Themes:ButtonChrome>
  160. <ControlTemplate.Triggers>
  161. <Trigger Property="IsChecked" Value="true">
  162. <Setter TargetName="Chrome" Property="RenderPressed" Value="true" />
  163. </Trigger>
  164. <Trigger Property="IsEnabled" Value="false">
  165. <Setter TargetName="Arrow" Property="Fill" Value="#AFAFAF" />
  166. </Trigger>
  167. </ControlTemplate.Triggers>
  168. </ControlTemplate>
  169. </Setter.Value>
  170. </Setter>
  171. </Style>
  172. <LinearGradientBrush x:Key="TextBoxBorder" MappingMode="Absolute" StartPoint="0,0" EndPoint="0,20">
  173. <GradientStop Offset="0.05" Color="#ABADB3" />
  174. <GradientStop Offset="0.07" Color="#E2E3EA" />
  175. <GradientStop Offset="1" Color="#E3E9EF" />
  176. </LinearGradientBrush>
  177. <Style x:Key="ComboBoxEditableTextBox" TargetType="{x:Type TextBox}">
  178. <Setter Property="OverridesDefaultStyle" Value="true" />
  179. <Setter Property="AllowDrop" Value="true" />
  180. <Setter Property="MinWidth" Value="0" />
  181. <Setter Property="MinHeight" Value="0" />
  182. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  183. <Setter Property="Template">
  184. <Setter.Value>
  185. <ControlTemplate TargetType="{x:Type TextBox}">
  186. <ScrollViewer x:Name="PART_ContentHost"
  187. Background="Transparent"
  188. Focusable="false"
  189. HorizontalScrollBarVisibility="Hidden"
  190. VerticalScrollBarVisibility="Hidden" />
  191. </ControlTemplate>
  192. </Setter.Value>
  193. </Setter>
  194. </Style>
  195. <Style x:Key="ComboBoxToggleButton2" TargetType="{x:Type ToggleButton}">
  196. <Setter Property="OverridesDefaultStyle" Value="true" />
  197. <Setter Property="IsTabStop" Value="false" />
  198. <Setter Property="Focusable" Value="false" />
  199. <Setter Property="ClickMode" Value="Press" />
  200. <Setter Property="Template">
  201. <Setter.Value>
  202. <ControlTemplate TargetType="{x:Type ToggleButton}">
  203. <Themes:ButtonChrome x:Name="Chrome"
  204. Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}"
  205. Background="{TemplateBinding Background}"
  206. BorderBrush="{TemplateBinding BorderBrush}"
  207. RenderMouseOver="{TemplateBinding IsMouseOver}"
  208. RenderPressed="{TemplateBinding IsPressed}"
  209. RoundCorners="false"
  210. SnapsToDevicePixels="true">
  211. <Path x:Name="Arrow"
  212. Margin="0,1,0,0"
  213. HorizontalAlignment="Center"
  214. VerticalAlignment="Center"
  215. Data="{StaticResource DownArrowGeometry}"
  216. Fill="Black" />
  217. </Themes:ButtonChrome>
  218. <ControlTemplate.Triggers>
  219. <Trigger Property="IsChecked" Value="true">
  220. <Setter TargetName="Chrome" Property="RenderPressed" Value="true" />
  221. </Trigger>
  222. <Trigger Property="IsEnabled" Value="false">
  223. <Setter TargetName="Arrow" Property="Fill" Value="#AFAFAF" />
  224. </Trigger>
  225. </ControlTemplate.Triggers>
  226. </ControlTemplate>
  227. </Setter.Value>
  228. </Setter>
  229. </Style>
  230. <ControlTemplate x:Key="ComboBoxEditableTemplate" TargetType="{x:Type ComboBox}">
  231. <Grid x:Name="Placement" SnapsToDevicePixels="true">
  232. <Grid.ColumnDefinitions>
  233. <ColumnDefinition Width="*" />
  234. <ColumnDefinition Width="Auto" />
  235. </Grid.ColumnDefinitions>
  236. <Popup x:Name="PART_Popup"
  237. Grid.ColumnSpan="2"
  238. AllowsTransparency="true"
  239. IsOpen="{Binding IsDropDownOpen,
  240. RelativeSource={RelativeSource TemplatedParent}}"
  241. Placement="Bottom"
  242. PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}">
  243. <Themes:SystemDropShadowChrome x:Name="Shdw"
  244. MinWidth="{Binding ActualWidth,
  245. ElementName=Placement}"
  246. MaxHeight="{TemplateBinding MaxDropDownHeight}"
  247. Color="Transparent">
  248. <Border x:Name="DropDownBorder"
  249. Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"
  250. BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}"
  251. BorderThickness="1">
  252. <ScrollViewer>
  253. <ItemsPresenter KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  254. </ScrollViewer>
  255. </Border>
  256. </Themes:SystemDropShadowChrome>
  257. </Popup>
  258. <Themes:ListBoxChrome x:Name="Border"
  259. Grid.ColumnSpan="2"
  260. Background="{TemplateBinding Background}"
  261. BorderBrush="{TemplateBinding BorderBrush}"
  262. BorderThickness="{TemplateBinding BorderThickness}"
  263. RenderFocused="{TemplateBinding IsKeyboardFocusWithin}"
  264. RenderMouseOver="{TemplateBinding IsMouseOver}" />
  265. <TextBox x:Name="PART_EditableTextBox"
  266. Margin="{TemplateBinding Padding}"
  267. HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
  268. VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
  269. IsReadOnly="{Binding IsReadOnly,
  270. RelativeSource={RelativeSource TemplatedParent}}"
  271. Style="{StaticResource ComboBoxEditableTextBox}" />
  272. <ToggleButton Grid.Column="1"
  273. IsChecked="{Binding IsDropDownOpen,
  274. Mode=TwoWay,
  275. RelativeSource={RelativeSource TemplatedParent}}"
  276. Style="{StaticResource ComboBoxToggleButton2}" />
  277. </Grid>
  278. <ControlTemplate.Triggers>
  279. <Trigger Property="IsKeyboardFocusWithin" Value="true">
  280. <Setter Property="Foreground" Value="Black" />
  281. </Trigger>
  282. <Trigger Property="IsDropDownOpen" Value="true">
  283. <Setter TargetName="Border" Property="RenderFocused" Value="true" />
  284. </Trigger>
  285. <Trigger Property="HasItems" Value="false">
  286. <Setter TargetName="DropDownBorder" Property="Height" Value="95" />
  287. </Trigger>
  288. <Trigger Property="IsEnabled" Value="false">
  289. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
  290. <Setter Property="Background" Value="#FFF4F4F4" />
  291. </Trigger>
  292. <Trigger Property="IsGrouping" Value="true">
  293. <Setter Property="ScrollViewer.CanContentScroll" Value="false" />
  294. </Trigger>
  295. <Trigger SourceName="PART_Popup" Property="HasDropShadow" Value="true">
  296. <Setter TargetName="Shdw" Property="Margin" Value="0,0,5,5" />
  297. <Setter TargetName="Shdw" Property="Color" Value="#71000000" />
  298. </Trigger>
  299. </ControlTemplate.Triggers>
  300. </ControlTemplate>
  301. <Style x:Key="ComboBoxStyle1" TargetType="{x:Type ComboBox}">
  302. <Setter Property="FocusVisualStyle" Value="{StaticResource ComboBoxFocusVisual}" />
  303. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}" />
  304. <Setter Property="Background" Value="{StaticResource ButtonNormalBackground}" />
  305. <Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}" />
  306. <Setter Property="BorderThickness" Value="1" />
  307. <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
  308. <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
  309. <Setter Property="Padding" Value="4,3" />
  310. <Setter Property="Template">
  311. <Setter.Value>
  312. <ControlTemplate TargetType="{x:Type ComboBox}">
  313. <Grid x:Name="MainGrid" SnapsToDevicePixels="true">
  314. <Grid.ColumnDefinitions>
  315. <ColumnDefinition Width="*" />
  316. <ColumnDefinition Width="0" MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" />
  317. </Grid.ColumnDefinitions>
  318. <Popup x:Name="PART_Popup"
  319. Grid.ColumnSpan="2"
  320. Margin="1"
  321. AllowsTransparency="true"
  322. IsOpen="{Binding IsDropDownOpen,
  323. RelativeSource={RelativeSource TemplatedParent}}"
  324. Placement="Bottom"
  325. PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}">
  326. <Themes:SystemDropShadowChrome x:Name="Shdw"
  327. MinWidth="{Binding ActualWidth,
  328. ElementName=MainGrid}"
  329. MaxHeight="{TemplateBinding MaxDropDownHeight}"
  330. Color="Transparent">
  331. <Border x:Name="DropDownBorder"
  332. Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"
  333. BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}"
  334. BorderThickness="1">
  335. <ScrollViewer CanContentScroll="true">
  336. <ItemsPresenter KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  337. </ScrollViewer>
  338. </Border>
  339. </Themes:SystemDropShadowChrome>
  340. </Popup>
  341. <ToggleButton Grid.ColumnSpan="2"
  342. Background="{TemplateBinding Background}"
  343. BorderBrush="{TemplateBinding BorderBrush}"
  344. IsChecked="{Binding IsDropDownOpen,
  345. Mode=TwoWay,
  346. RelativeSource={RelativeSource TemplatedParent}}"
  347. Style="{StaticResource ComboBoxReadonlyToggleButton}" />
  348. <ContentPresenter Margin="{TemplateBinding Padding}"
  349. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  350. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  351. Content="{TemplateBinding SelectionBoxItem}"
  352. ContentStringFormat="{TemplateBinding SelectionBoxItemStringFormat}"
  353. ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
  354. ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
  355. IsHitTestVisible="false"
  356. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  357. </Grid>
  358. <ControlTemplate.Triggers>
  359. <Trigger SourceName="PART_Popup" Property="HasDropShadow" Value="true">
  360. <Setter TargetName="Shdw" Property="Margin" Value="0,0,5,5" />
  361. <Setter TargetName="Shdw" Property="Color" Value="#71000000" />
  362. </Trigger>
  363. <Trigger Property="HasItems" Value="false">
  364. <Setter TargetName="DropDownBorder" Property="Height" Value="95" />
  365. </Trigger>
  366. <Trigger Property="IsEnabled" Value="false">
  367. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
  368. <Setter Property="Background" Value="#FFF4F4F4" />
  369. </Trigger>
  370. <Trigger Property="IsGrouping" Value="true">
  371. <Setter Property="ScrollViewer.CanContentScroll" Value="false" />
  372. </Trigger>
  373. </ControlTemplate.Triggers>
  374. </ControlTemplate>
  375. </Setter.Value>
  376. </Setter>
  377. <Style.Triggers>
  378. <Trigger Property="IsEditable" Value="true">
  379. <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorder}" />
  380. <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" />
  381. <Setter Property="IsTabStop" Value="false" />
  382. <Setter Property="Padding" Value="3" />
  383. <Setter Property="Template" Value="{StaticResource ComboBoxEditableTemplate}" />
  384. </Trigger>
  385. </Style.Triggers>
  386. </Style>
  387. <Style x:Key="NomalTextBlockStyle" TargetType="TextBlock">
  388. <Setter Property="Foreground" Value="{DynamicResource MuchinfoBrush30}" />
  389. <Setter Property="FontWeight" Value="Bold" />
  390. </Style>
  391. <Style x:Key="NumberTextBlockStyle" TargetType="TextBlock">
  392. <Setter Property="Foreground" Value="{DynamicResource MuchinfoBrush31}" />
  393. <Setter Property="FontWeight" Value="Bold" />
  394. </Style>
  395. <Style x:Key="RectangleTextBox" TargetType="{x:Type TextBox}">
  396. <Setter Property="BorderBrush" Value="{DynamicResource CommonBorderBrush}" />
  397. <Setter Property="BorderThickness" Value="1" />
  398. <Setter Property="Height" Value="24" />
  399. <Setter Property="IsEnabled" Value="False" />
  400. <Setter Property="Foreground" Value="{DynamicResource ContentForeGround}" />
  401. <Setter Property="Background" Value="{DynamicResource ContentBackground}" />
  402. <Setter Property="Padding" Value="1" />
  403. <Setter Property="KeyboardNavigation.TabNavigation" Value="None" />
  404. <Setter Property="HorizontalContentAlignment" Value="Center" />
  405. <Setter Property="VerticalContentAlignment" Value="Center" />
  406. <Setter Property="VerticalAlignment" Value="Stretch" />
  407. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  408. <Setter Property="AllowDrop" Value="true" />
  409. <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst" />
  410. <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
  411. <Setter Property="Template">
  412. <Setter.Value>
  413. <ControlTemplate TargetType="{x:Type TextBox}">
  414. <Border Background="{TemplateBinding Background}"
  415. BorderBrush="{TemplateBinding BorderBrush}"
  416. BorderThickness="{TemplateBinding BorderThickness}"
  417. CornerRadius="3">
  418. <Grid>
  419. <ScrollViewer x:Name="PART_ContentHost"
  420. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  421. VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
  422. <Rectangle x:Name="rectangle"
  423. HorizontalAlignment="Stretch"
  424. VerticalAlignment="Stretch"
  425. Fill="#50585858"
  426. Visibility="Collapsed" />
  427. </Grid>
  428. </Border>
  429. <ControlTemplate.Triggers>
  430. <Trigger Property="IsEnabled" Value="false">
  431. <Setter TargetName="rectangle" Property="Visibility" Value="Visible" />
  432. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
  433. </Trigger>
  434. </ControlTemplate.Triggers>
  435. </ControlTemplate>
  436. </Setter.Value>
  437. </Setter>
  438. </Style>
  439. <Style x:Key="TextBoxStyle" TargetType="TextBox">
  440. <Setter Property="Margin" Value="5,1,0,1" />
  441. <Setter Property="HorizontalAlignment" Value="Left" />
  442. <Setter Property="Height" Value="23" />
  443. <Setter Property="Template">
  444. <Setter.Value>
  445. <ControlTemplate TargetType="{x:Type TextBox}">
  446. <Border x:Name="border"
  447. Width="Auto"
  448. BorderBrush="DarkGray"
  449. BorderThickness="1">
  450. <Grid x:Name="grid" Background="#FFFFFF">
  451. <ScrollViewer x:Name="PART_ContentHost"
  452. HorizontalAlignment="Left"
  453. VerticalAlignment="Center"
  454. VerticalContentAlignment="Center" />
  455. </Grid>
  456. </Border>
  457. </ControlTemplate>
  458. </Setter.Value>
  459. </Setter>
  460. </Style>
  461. </ResourceDictionary>