CustomBtnStyle.xaml 5.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:customControl ="clr-namespace:PDF_Office.CustomControl"
  4. >
  5. <SolidColorBrush x:Key="Common.Border" Color="#FF273C62"/>
  6. <SolidColorBrush x:Key="Common.ForGround.Blue" Color="#FF273C62"/>
  7. <SolidColorBrush x:Key="Common.ForGround.Black" Color="#FF000000"/>
  8. <SolidColorBrush x:Key="Button.Static.Background" Color="#273C62"/>
  9. <SolidColorBrush x:Key="Button.Static.Border" Color="#FF273C62"/>
  10. <SolidColorBrush x:Key="Button.MouseOver.Background" Color="#1A477EDE"/>
  11. <SolidColorBrush x:Key="Button.MouseOver.Border" Color="#273C62"/>
  12. <SolidColorBrush x:Key="Button.Pressed.Background" Color="#29477EDE"/>
  13. <SolidColorBrush x:Key="Button.Pressed.Border" Color="#FF2C628B"/>
  14. <SolidColorBrush x:Key="Button.Disabled.Background" Color="#273C62"/>
  15. <SolidColorBrush x:Key="Button.Disabled.Border" Color="#273C62"/>
  16. <SolidColorBrush x:Key="Button.Disabled.Foreground" Color="#26FFFFFF"/>
  17. <SolidColorBrush x:Key="CloseButton.MouseOver.Foreground" Color="Red"/>
  18. <SolidColorBrush x:Key="Disabled.ForeGround" Color="#FFE2E3E6" />
  19. <SolidColorBrush x:Key="BlueBtn.Mouseover.Background" Color="#31538D" />
  20. <SolidColorBrush x:Key="BlueBtn.Pressed.Background" Color="#1B2944" />
  21. <SolidColorBrush x:Key="Redact.Background" Color="#477EDE"/>
  22. <Style x:Key="ToggleBtnViewModeStyle" TargetType="customControl:CustomIconToggleBtn">
  23. <Setter Property="Background" Value="{StaticResource Button.Static.Background}"/>
  24. <Setter Property="BorderBrush" Value="{StaticResource Button.Static.Border}"/>
  25. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
  26. <Setter Property="BorderThickness" Value="0"/>
  27. <Setter Property="HorizontalContentAlignment" Value="Center"/>
  28. <Setter Property="Height" Value="40"/>
  29. <Setter Property="Margin" Value="4,0,4,0"/>
  30. <Setter Property="Template">
  31. <Setter.Value>
  32. <ControlTemplate TargetType="customControl:CustomIconToggleBtn">
  33. <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
  34. <Grid >
  35. <Grid Width="40" Height="40" VerticalAlignment="Center" HorizontalAlignment="Center">
  36. <Image x:Name="ImageIcon" Width="20" Height="20" Source="{Binding Icon,RelativeSource={RelativeSource Mode=TemplatedParent}}" Visibility="Collapsed"/>
  37. </Grid>
  38. <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
  39. </Grid>
  40. </Border>
  41. <ControlTemplate.Triggers>
  42. <Trigger Property="IsMouseOver" Value="true">
  43. <Setter Property="Background" TargetName="border" Value="{StaticResource Button.MouseOver.Background}"/>
  44. <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.MouseOver.Border}"/>
  45. </Trigger>
  46. <Trigger Property="IsPressed" Value="true">
  47. <Setter Property="Background" TargetName="border" Value="{StaticResource Button.Pressed.Background}"/>
  48. <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Pressed.Border}"/>
  49. </Trigger>
  50. <Trigger Property="IsEnabled" Value="false">
  51. <Setter Property="Background" TargetName="border" Value="{StaticResource Button.Disabled.Background}"/>
  52. <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Disabled.Border}"/>
  53. <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource Button.Disabled.Foreground}"/>
  54. <Setter Property="Opacity" TargetName="contentPresenter" Value="0.5"/>
  55. </Trigger>
  56. </ControlTemplate.Triggers>
  57. </ControlTemplate>
  58. </Setter.Value>
  59. </Setter>
  60. <Style.Triggers>
  61. <Trigger Property="IsChecked" Value="True">
  62. <Setter Property="Background" Value="{StaticResource Button.Pressed.Background}"></Setter>
  63. </Trigger>
  64. <Trigger Property="IsChecked" Value="False">
  65. <Setter Property="Background" Value="Transparent"></Setter>
  66. </Trigger>
  67. <Trigger Property="IsChecked" Value="{x:Null}">
  68. <Setter Property="Background" Value="Transparent"></Setter>
  69. </Trigger>
  70. </Style.Triggers>
  71. </Style>
  72. </ResourceDictionary>