AduRadioButton.xaml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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:CyberX8_Themes.CustomControls"
  4. xmlns:Attach="clr-namespace:CyberX8_UI.Themes.Attach"
  5. >
  6. <ResourceDictionary.MergedDictionaries>
  7. <ResourceDictionary Source="/CyberX8_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="Opacity" Value="1" />-->
  20. <!--<Setter Property="Effect">
  21. <Setter.Value>
  22. <DropShadowEffect Color="LightBlue"></DropShadowEffect>
  23. </Setter.Value>
  24. </Setter>-->
  25. <Setter Property="Attach:IconElement.Margin" Value="15,0"/>
  26. <Setter Property="Attach:IconElement.Width" Value="16"/>
  27. <Setter Property="Margin" Value="10,0,0,0"/>
  28. <Setter Property="Padding" Value="0" />
  29. <Setter Property="BorderThickness" Value="0,0,0,0"></Setter>
  30. <Setter Property="Template">
  31. <Setter.Value>
  32. <ControlTemplate TargetType="{x:Type customControl:AduRadioButtonIcon}">
  33. <Border
  34. x:Name="templateRoot"
  35. Background="{Binding DefaultBackground, RelativeSource={RelativeSource Mode=TemplatedParent}}"
  36. Margin="{TemplateBinding Margin}"
  37. Padding="{TemplateBinding Padding}"
  38. BorderBrush="{TemplateBinding BorderBrush}"
  39. BorderThickness="{TemplateBinding BorderThickness}"
  40. CornerRadius="5">
  41. <StackPanel
  42. VerticalAlignment="Center"
  43. HorizontalAlignment="Center"
  44. Orientation="Horizontal"
  45. Margin="0"
  46. SnapsToDevicePixels="True">
  47. <Border>
  48. <Path x:Name="Icon" VerticalAlignment="Center" Width="{TemplateBinding Attach:IconElement.Width}" Margin="0,0,10,0" Fill="{TemplateBinding Foreground}" Stretch="Uniform" Data="{TemplateBinding Attach:IconElement.PathData}" />
  49. </Border>
  50. <TextBlock
  51. x:Name="contentPresenter"
  52. Grid.Column="1"
  53. Foreground="{TemplateBinding Foreground}"
  54. Margin="0,0,3,0"
  55. HorizontalAlignment="Left"
  56. VerticalAlignment="Center"
  57. Text="{TemplateBinding Content}"
  58. Padding="0,0,0,0"
  59. Focusable="False"
  60. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  61. </StackPanel>
  62. </Border>
  63. <ControlTemplate.Triggers>
  64. <!--<Trigger Property="IsMouseOver" Value="True" >
  65. <Setter TargetName="templateRoot" Property="Opacity" Value=".8" />
  66. </Trigger>-->
  67. <Trigger Property="IsEnabled" Value="False" />
  68. <Trigger Property="IsPressed" Value="True" />
  69. <Trigger Property="IsChecked" Value="True">
  70. <Setter TargetName="templateRoot" Property="Background" Value="{Binding SelectBackground, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
  71. <!--<Setter Property="Opacity" Value="1" />-->
  72. <Setter Property="IsEnabled" Value="False" />
  73. <Setter TargetName="templateRoot" Property="BorderThickness" Value="0" />
  74. <Setter TargetName="Icon" Property="Fill" Value="{Binding SelectColor, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
  75. <Setter TargetName="templateRoot" Property="BorderBrush" Value="{Binding SelectColor, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
  76. <Setter TargetName="contentPresenter" Property="Foreground" Value="{Binding SelectColor, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
  77. <Setter Property="customControl:AduRadioButtonIcon.Effect">
  78. <Setter.Value>
  79. <DropShadowEffect Color="Black"></DropShadowEffect>
  80. </Setter.Value>
  81. </Setter>
  82. <!--<Setter Property="customControl:AduRadioButtonIcon.FontSize" Value="26"/>-->
  83. </Trigger>
  84. </ControlTemplate.Triggers>
  85. </ControlTemplate>
  86. </Setter.Value>
  87. </Setter>
  88. </Style>
  89. </ResourceDictionary>