日期:2014-05-18 浏览次数:21088 次
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Style TargetType="Button" x:Key="foxbutton"> <Setter Property="Background" Value="Green"/> </Style> <Style x:Key="EllipseButton" TargetType="{x:Type Button}"> <Setter Property="Height" Value="100"/> <Setter Property="Width" Value="100"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Button}"> <Grid> <Ellipse> <Ellipse.Effect> <BlurEffect Radius="23"/> </Ellipse.Effect> <Ellipse.Fill> <RadialGradientBrush> <GradientStop Color="#FFEB1C1C" Offset="0"/> <GradientStop Color="#B2DA3361" Offset="1"/> </RadialGradientBrush> </Ellipse.Fill> <Ellipse.Stroke> <LinearGradientBrush EndPoint="0.5,1" MappingMode="RelativeToBoundingBox" StartPoint="0.5,0"> <GradientStop Color="#FFC6EF18" Offset="0"/> <GradientStop Color="#FFDA1F97" Offset="1"/> </LinearGradientBrush> </Ellipse.Stroke> </Ellipse> <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> </Grid> </ControlTemplate> </Setter.Value> </Setter> <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Foreground" Value="Red"/> </Trigger> </Style.Triggers> </Style> </ResourceDictionary>