ToolsBtnStyle.xaml 1.9 KB

12345678910111213141516171819202122232425262728
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  3. <Style x:Key="ToolsBtnStyle" TargetType="{x:Type Button}">
  4. <Setter Property="Background" Value="Transparent"/>
  5. <Setter Property="BorderBrush" Value="Transparent"/>
  6. <Setter Property="Width" Value="auto"/>
  7. <Setter Property="Height" Value="40"/>
  8. <Setter Property="Template">
  9. <Setter.Value>
  10. <ControlTemplate TargetType="{x:Type Button}">
  11. <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
  12. <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
  13. </Border>
  14. <ControlTemplate.Triggers>
  15. <Trigger Property="IsMouseOver" Value="true">
  16. <Setter Property="Background" TargetName="border" Value="#1A000000"/>
  17. <Setter Property="BorderBrush" TargetName="border" Value= "gray"/>
  18. </Trigger>
  19. <Trigger Property="IsPressed" Value="true">
  20. <Setter Property="Background" TargetName="border" Value="#26000000"/>
  21. <Setter Property="BorderBrush" TargetName="border" Value= "gray"/>
  22. </Trigger>
  23. </ControlTemplate.Triggers>
  24. </ControlTemplate>
  25. </Setter.Value>
  26. </Setter>
  27. </Style>
  28. </ResourceDictionary>