AduRadioButton.xaml 4.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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:Venus_Themes.CustomControls"
  4. xmlns:Attach="clr-namespace:Venus_UI.Themes.Attach"
  5. >
  6. <ResourceDictionary.MergedDictionaries>
  7. <ResourceDictionary Source="/Venus_Themes;component/Themes/Generic.xaml"/>
  8. </ResourceDictionary.MergedDictionaries>
  9. <Style TargetType="{x:Type customControl:AduRadioButtonIcon}">
  10. <Setter Property="Height" Value="30" />
  11. <Setter Property="Cursor" Value="Hand" />
  12. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  13. <Setter Property="Background" Value="White" />
  14. <Setter Property="BorderBrush" Value="Transparent" />
  15. <Setter Property="FontSize" Value="20" />
  16. <Setter Property="FontFamily" Value="Arial" />
  17. <Setter Property="FontWeight" Value="DemiBold" />
  18. <Setter Property="Foreground" Value="White" />
  19. <Setter Property="Effect">
  20. <Setter.Value>
  21. <DropShadowEffect Color="LightBlue"></DropShadowEffect>
  22. </Setter.Value>
  23. </Setter>
  24. <Setter Property="Attach:IconElement.Margin" Value="15,0"/>
  25. <Setter Property="Attach:IconElement.Width" Value="16"/>
  26. <Setter Property="Margin" Value="10,0,0,0"/>
  27. <Setter Property="Padding" Value="0" />
  28. <Setter Property="BorderThickness" Value="0,0,0,0"></Setter>
  29. <Setter Property="Template">
  30. <Setter.Value>
  31. <ControlTemplate TargetType="{x:Type customControl:AduRadioButtonIcon}">
  32. <Border
  33. x:Name="templateRoot"
  34. Background="#00FFFFFF"
  35. Margin="{TemplateBinding Margin}"
  36. Padding="{TemplateBinding Padding}"
  37. BorderBrush="{TemplateBinding BorderBrush}"
  38. BorderThickness="{TemplateBinding BorderThickness}">
  39. <StackPanel
  40. VerticalAlignment="Center"
  41. Orientation="Horizontal"
  42. SnapsToDevicePixels="True">
  43. <Border>
  44. <Path x:Name="Icon" VerticalAlignment="Center" Width="{TemplateBinding Attach:IconElement.Width}" Margin="{TemplateBinding Attach:IconElement.Margin}" Fill="{TemplateBinding Foreground}" Stretch="Uniform" Data="{TemplateBinding Attach:IconElement.PathData}" />
  45. </Border>
  46. <TextBlock
  47. x:Name="contentPresenter"
  48. Grid.Column="1"
  49. Foreground="{TemplateBinding Foreground}"
  50. Margin="0,0,5,0"
  51. HorizontalAlignment="Left"
  52. VerticalAlignment="Center"
  53. Text="{TemplateBinding Content}"
  54. Focusable="False"
  55. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  56. </StackPanel>
  57. </Border>
  58. <ControlTemplate.Triggers>
  59. <Trigger Property="IsMouseOver" Value="True" >
  60. <Setter TargetName="templateRoot" Property="Opacity" Value=".8" />
  61. </Trigger>
  62. <Trigger Property="IsEnabled" Value="False" />
  63. <Trigger Property="IsPressed" Value="True" />
  64. <Trigger Property="IsChecked" Value="True">
  65. <Setter TargetName="templateRoot" Property="Background" Value="{Binding SelectBackground, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
  66. <Setter TargetName="templateRoot" Property="Opacity" Value=".8" />
  67. <Setter TargetName="templateRoot" Property="BorderThickness" Value="0" />
  68. <Setter TargetName="Icon" Property="Fill" Value="{Binding SelectColor, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
  69. <Setter TargetName="templateRoot" Property="BorderBrush" Value="{Binding SelectColor, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
  70. <Setter TargetName="contentPresenter" Property="Foreground" Value="{Binding SelectColor, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
  71. </Trigger>
  72. </ControlTemplate.Triggers>
  73. </ControlTemplate>
  74. </Setter.Value>
  75. </Setter>
  76. </Style>
  77. </ResourceDictionary>