ButtonDictionary.xaml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  3. <LinearGradientBrush x:Key="BaseButton_Blue_BorderColor" StartPoint="0,0" EndPoint="0,1">
  4. <GradientStop Color="#0c64f2" Offset="0.0" />
  5. <GradientStop Color=" #00358a" Offset="1.0" />
  6. </LinearGradientBrush>
  7. <LinearGradientBrush x:Key="BaseButton_Blue_BorderColorMouseOver" StartPoint="0,0" EndPoint="0,1">
  8. <GradientStop Color="#0090ff" Offset="0.0" />
  9. <GradientStop Color=" #00358a" Offset="1.0" />
  10. </LinearGradientBrush>
  11. <LinearGradientBrush x:Key="BaseButton_Blue_BorderColorPressed" StartPoint="0,0" EndPoint="0,1">
  12. <GradientStop Color="#0090d9" Offset="0.0" />
  13. <GradientStop Color=" #00358a" Offset="1.0" />
  14. </LinearGradientBrush>
  15. <LinearGradientBrush x:Key="BaseButton_Blue_BackgroundColor" StartPoint="0,0" EndPoint="0,1">
  16. <GradientStop Color="#004ecc" Offset="0.0" />
  17. <GradientStop Color="#004ecc" Offset="0.5" />
  18. <GradientStop Color="#002c73" Offset="1.0" />
  19. </LinearGradientBrush>
  20. <SolidColorBrush x:Key="BaseButton_Blue_BackgroundPressed" Color="#002c73" />
  21. <Style x:Key="BaseButton_Blue" TargetType="{x:Type Button}">
  22. <Setter Property="SnapsToDevicePixels" Value="True" />
  23. <Setter Property="OverridesDefaultStyle" Value="True" />
  24. <Setter Property="BorderBrush" Value="{StaticResource BaseButton_Blue_BorderColor}" />
  25. <Setter Property="BorderThickness" Value="1" />
  26. <Setter Property="Background" Value="{StaticResource BaseButton_Blue_BackgroundColor}" />
  27. <Setter Property="VerticalContentAlignment" Value="Center" />
  28. <Setter Property="HorizontalContentAlignment" Value="Center" />
  29. <Setter Property="FontSize" Value="16" />
  30. <Setter Property="Foreground" Value="#B8CBE6" />
  31. <Setter Property="Padding" Value="10" />
  32. <Setter Property="Template">
  33. <Setter.Value>
  34. <ControlTemplate TargetType="Button">
  35. <Border x:Name="border" CornerRadius="5" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}" Padding="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalAlignment}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="True">
  36. <ContentPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="0" />
  37. </Border>
  38. <ControlTemplate.Triggers>
  39. <Trigger Property="IsMouseOver" Value="True">
  40. <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource BaseButton_Blue_BorderColorMouseOver}" />
  41. </Trigger>
  42. <Trigger Property="IsPressed" Value="True">
  43. <Setter TargetName="border" Property="Background" Value="{StaticResource BaseButton_Blue_BackgroundPressed}" />
  44. <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource BaseButton_Blue_BorderColorPressed}" />
  45. </Trigger>
  46. <Trigger Property="IsEnabled" Value="false">
  47. <Setter TargetName="border" Property="Background" Value="Black" />
  48. </Trigger>
  49. </ControlTemplate.Triggers>
  50. </ControlTemplate>
  51. </Setter.Value>
  52. </Setter>
  53. </Style>
  54. </ResourceDictionary>