- <ControlTemplate x:Key="myButton" TargetType="Button">
- <Grid Width="{TemplateBinding ActualWidth}"
- Height="{TemplateBinding ActualHeight}" Background="#00FFFFFF">
- <Ellipse Name="Circle" StrokeThickness="1">
- <Ellipse.Fill>
- <LinearGradientBrush EndPoint="2.2,0" StartPoint="0,0">
- <LinearGradientBrush.GradientStops>
- <GradientStop Offset="0" Color="LightGray" />
- <GradientStop Offset="0.3" Color="Gray" />
- </LinearGradientBrush.GradientStops>
- </LinearGradientBrush>
- </Ellipse.Fill>
- </Ellipse>
- <ContentPresenter x:Name="content" HorizontalAlignment="Center" VerticalAlignment="Center"/>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="UIElement.IsEnabled" Value="false">
- <Setter Property="Shape.Fill" TargetName="Circle">
- <Setter.Value>
- <LinearGradientBrush EndPoint="2.2,0" StartPoint="0,0">
- <LinearGradientBrush.GradientStops>
- <GradientStop Offset="0" Color="#FFFFFFFF" />
- <GradientStop Offset="0.5" Color="#FFEBEEF5" />
- <GradientStop Offset="0.5" Color="#FFD8DDEB" />
- <GradientStop Offset="1" Color="#FFDFE2F0" />
- </LinearGradientBrush.GradientStops>
- </LinearGradientBrush>
- </Setter.Value>
- </Setter>
- </Trigger>
- <Trigger Property="UIElement.IsMouseOver" Value="true">
- <Setter Property="Shape.Fill" TargetName="Circle">
- <Setter.Value>
- <LinearGradientBrush EndPoint="2.2,0" StartPoint="0,0">
- <LinearGradientBrush.GradientStops>
- <GradientStop Offset="0" Color="#FFFFFFFF" />
- <GradientStop Offset="0.1" Color="#FFDFEDF9" />
- <GradientStop Offset="0.47" Color="#FF3086E1" />
- <GradientStop Offset="0.47" Color="#FF003B91" />
- <GradientStop Offset="0.7" Color="#FF1793EF" />
- <GradientStop Offset="0.85" Color="#FF5AD4FF" />
- <GradientStop Offset="0.95" Color="#FFBDFFFF" />
- <GradientStop Offset="1" Color="#FFFFFFFF" />
- </LinearGradientBrush.GradientStops>
- </LinearGradientBrush>
- </Setter.Value>
- </Setter>
- </Trigger>
- <Trigger Property="ButtonBase.IsPressed" Value="True">
- <Setter Property="Shape.Fill" TargetName="Circle">
- <Setter.Value>
- <LinearGradientBrush EndPoint="2.2,0" StartPoint="0,0">
- <LinearGradientBrush.GradientStops>
- <GradientStop Offset="0" Color="#FFC0D2F5" />
- <GradientStop Offset="0.47" Color="#FF5E7A9C" />
- <GradientStop Offset="0.47" Color="#FF00062D" />
- <GradientStop Offset="0.7" Color="#FF005F9F" />
- <GradientStop Offset="0.85" Color="#FF1FA4E2" />
- <GradientStop Offset="0.95" Color="#FF61DAFF" />
- <GradientStop Offset="1" Color="#FF48CFFF" />
- </LinearGradientBrush.GradientStops>
- </LinearGradientBrush>
- </Setter.Value>
- </Setter>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
Result:
No action
IsMouseOver
IsPressed
No comments:
Post a Comment
Note: only a member of this blog may post a comment.