日期:2014-05-18 浏览次数:20888 次
<RadioButton.Style> <Style TargetType="{x:Type RadioButton}"> <Style.Resources> <Style x:Key="CheckRadioFocusVisual"> <Setter Property="Control.Template"> <Setter.Value> <ControlTemplate> <Rectangle Margin="14,0,0,0" StrokeThickness="1" Stroke="Black" StrokeDashArray="1 2" SnapsToDevicePixels="true"/> </ControlTemplate> </Setter.Value> </Setter> </Style> </Style.Resources> <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/> <Setter Property="Background" Value="Transparent"/> <Setter Property="BorderBrush" Value="#dddddd"/> <Setter Property="BorderThickness" Value="1"/> <Setter Property="HorizontalAlignment" Value="Center"/> <Setter Property="VerticalAlignment" Value="Center"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type RadioButton}"> <BulletDecorator Background="Transparent"> <BulletDecorator.Bullet> <!-- 这里是修改过的部分 开始 --> <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"> <Image x:Name="PART_Image" Width="12"> <Image.Source> <DrawingImage> <DrawingImage.Drawing> <GeometryDrawing Brush="OrangeRed" Geometry="M 0 0 L 3.5 4 L 7 0 Z"/> </DrawingImage.Drawing> </DrawingImage> </Image.Source> <Image.Effect> <DropShadowEffect BlurRadius="1" Opacity="0.75" ShadowDepth="0"/> </Image.Effect> </Image> </Border> <!-- 这里是修改过的部分 结束 --> </BulletDecorator.Bullet> <ContentPresenter Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"