ButtonStyle.xaml 1.7 KB

12345678910111213141516171819202122232425262728293031
  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="TransparentButtonStyle" TargetType="{x:Type Button}">
  4. <Setter Property="Background" Value="Transparent"/>
  5. <Setter Property="BorderBrush" Value="Transparent"/>
  6. <Setter Property="Foreground" Value="White"/>
  7. <Setter Property="Template">
  8. <Setter.Value>
  9. <ControlTemplate TargetType="{x:Type Button}">
  10. <Border x:Name="border"
  11. Background="{TemplateBinding Background}"
  12. BorderBrush="{TemplateBinding BorderBrush}"
  13. BorderThickness="{TemplateBinding BorderThickness}">
  14. <ContentPresenter HorizontalAlignment="Center"
  15. VerticalAlignment="Center"/>
  16. </Border>
  17. <ControlTemplate.Triggers>
  18. <Trigger Property="IsMouseOver" Value="True">
  19. <Setter TargetName="border" Property="Background" Value="#4C000000"/>
  20. <Setter TargetName="border" Property="BorderBrush" Value="White"/>
  21. </Trigger>
  22. <Trigger Property="IsPressed" Value="True">
  23. <Setter TargetName="border" Property="Background" Value="#80000000"/>
  24. <Setter TargetName="border" Property="BorderBrush" Value="White"/>
  25. </Trigger>
  26. </ControlTemplate.Triggers>
  27. </ControlTemplate>
  28. </Setter.Value>
  29. </Setter>
  30. </Style>
  31. </ResourceDictionary>