AduRadioButton.xaml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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="16" />
  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. Padding="0,0,0,1"
  55. Focusable="False"
  56. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  57. </StackPanel>
  58. </Border>
  59. <ControlTemplate.Triggers>
  60. <Trigger Property="IsMouseOver" Value="True" >
  61. <Setter TargetName="templateRoot" Property="Opacity" Value=".8" />
  62. </Trigger>
  63. <Trigger Property="IsEnabled" Value="False" />
  64. <Trigger Property="IsPressed" Value="True" />
  65. <Trigger Property="IsChecked" Value="True">
  66. <Setter TargetName="templateRoot" Property="Background" Value="{Binding SelectBackground, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
  67. <Setter TargetName="templateRoot" Property="Opacity" Value=".8" />
  68. <Setter TargetName="templateRoot" Property="BorderThickness" Value="0" />
  69. <Setter TargetName="Icon" Property="Fill" Value="{Binding SelectColor, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
  70. <Setter TargetName="templateRoot" Property="BorderBrush" Value="{Binding SelectColor, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
  71. <Setter TargetName="contentPresenter" Property="Foreground" Value="{Binding SelectColor, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
  72. <Setter Property="customControl:AduRadioButtonIcon.Effect">
  73. <Setter.Value>
  74. <DropShadowEffect Color="Black"></DropShadowEffect>
  75. </Setter.Value>
  76. </Setter>
  77. <Setter Property="customControl:AduRadioButtonIcon.FontSize" Value="26"/>
  78. </Trigger>
  79. </ControlTemplate.Triggers>
  80. </ControlTemplate>
  81. </Setter.Value>
  82. </Setter>
  83. </Style>
  84. </ResourceDictionary>