TextBox.xaml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  2. <Style TargetType="TextBox">
  3. <Setter Property="FontFamily" Value="/PicView;component/Library/Resources/fonts/#TeX Gyre Heros" />
  4. <Setter Property="FontSize" Value="14" />
  5. <Setter Property="Background" Value="{StaticResource BackgroundColorBrushAlt}" />
  6. <Setter Property="BorderThickness" Value="1" />
  7. <Setter Property="BorderBrush" Value="{StaticResource BorderBrush}" />
  8. <Setter Property="Foreground" Value="{StaticResource MainColorBrush}" />
  9. <Setter Property="CaretBrush" Value="{StaticResource MainColorBrush}" />
  10. <Setter Property="Template">
  11. <Setter.Value>
  12. <ControlTemplate TargetType="{x:Type TextBox}">
  13. <Border
  14. x:Name="border"
  15. Background="{TemplateBinding Background}"
  16. BorderBrush="{TemplateBinding BorderBrush}"
  17. BorderThickness="{TemplateBinding BorderThickness}"
  18. CornerRadius="0"
  19. SnapsToDevicePixels="True">
  20. <ScrollViewer
  21. x:Name="PART_ContentHost"
  22. Focusable="false"
  23. HorizontalScrollBarVisibility="Hidden"
  24. VerticalScrollBarVisibility="Hidden" />
  25. </Border>
  26. <ControlTemplate.Triggers>
  27. <Trigger Property="IsEnabled" Value="false">
  28. <Setter TargetName="border" Property="Opacity" Value="0.56" />
  29. </Trigger>
  30. <Trigger Property="IsMouseOver" Value="true">
  31. <Setter TargetName="border" Property="BorderBrush" Value="{DynamicResource ResourceKey=ChosenColorBrush}" />
  32. </Trigger>
  33. <Trigger Property="IsFocused" Value="true">
  34. <Setter TargetName="border" Property="BorderBrush" Value="{DynamicResource ResourceKey=ChosenColorBrush}" />
  35. </Trigger>
  36. </ControlTemplate.Triggers>
  37. </ControlTemplate>
  38. </Setter.Value>
  39. </Setter>
  40. </Style>
  41. </ResourceDictionary>