模仿36。杀毒~button(转)

<Style x:Key="360btn" TargetType="{x:Type Button}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<ControlTemplate.Resources>
<Storyboard x:Key="Storyboard1">
<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Storyboard.TargetName="border">
<EasingColorKeyFrame KeyTime="0" Value="White"/>
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" Storyboard.TargetName="border">
<EasingColorKeyFrame KeyTime="0" Value="White"/>
<EasingColorKeyFrame KeyTime="0:0:0.1" Value="#FFA2E5A0"/>
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Stroke).(SolidColorBrush.Color)" Storyboard.TargetName="p2">
<EasingColorKeyFrame KeyTime="0:0:0.1" Value="White"/>
<EasingColorKeyFrame KeyTime="0:0:0.3" Value="#FF41C236"/>
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Stroke).(SolidColorBrush.Color)" Storyboard.TargetName="p3">
<EasingColorKeyFrame KeyTime="0:0:0.2" Value="White"/>
<EasingColorKeyFrame KeyTime="0:0:0.4" Value="#FF41C236"/>
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Stroke).(SolidColorBrush.Color)" Storyboard.TargetName="p4">
<EasingColorKeyFrame KeyTime="0:0:0.3" Value="White"/>
<EasingColorKeyFrame KeyTime="0:0:0.5" Value="#FF41C236"/>
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Stroke).(SolidColorBrush.Color)" Storyboard.TargetName="p5">
<EasingColorKeyFrame KeyTime="0:0:0.4" Value="White"/>
<EasingColorKeyFrame KeyTime="0:0:0.6" Value="#FF41C236"/>
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Stroke).(SolidColorBrush.Color)" Storyboard.TargetName="p1">
<EasingColorKeyFrame KeyTime="0" Value="White"/>
<EasingColorKeyFrame KeyTime="0:0:0.1" Value="#FF41C236"/>
</ColorAnimationUsingKeyFrames>
</Storyboard>
</ControlTemplate.Resources>

<Border x:Name="border" CornerRadius="70" BorderBrush="white" BorderThickness="6" Height="142" Width="143" Background="Black">
<Grid>
<Rectangle x:Name="rectangle" Fill="White" HorizontalAlignment="Left" Height="130" RadiusY="65" RadiusX="65" Stroke="#41C236" StrokeThickness="3" VerticalAlignment="Top" Width="131"/>
<Rectangle Fill="White" HorizontalAlignment="Left" Height="50" Margin="36" RadiusY="65" RadiusX="65" Stroke="#41C236" StrokeThickness="3" VerticalAlignment="Top" Width="50"/>
<Rectangle Fill="#41C236" HorizontalAlignment="Left" Height="9.448" Margin="80 80 0 0" Stroke="#41C236" StrokeThickness="3" VerticalAlignment="Top" Width="23.729" RenderTransformOrigin="0.5,0.5" RadiusY="3.654" RadiusX="3.654">
<Rectangle.RenderTransform>
<TransformGroup>
<RotateTransform Angle="32.454"/>
</TransformGroup>
</Rectangle.RenderTransform>
</Rectangle>
<Path x:Name="p1" Data="M150,120 L173,120" Fill="White" HorizontalAlignment="Left" Height="3" Margin="40 66 0 0" Stretch="Fill" Stroke="#41C236" StrokeThickness="3" VerticalAlignment="Top" Width="17"/>
<Path x:Name="p2" Data="M171,124 L181,111" Fill="White" HorizontalAlignment="Left" Height="20.314" Margin="50 48 0 0" Stretch="Fill" Stroke="#41C236" StrokeThickness="3" VerticalAlignment="Top" Width="17.23" RenderTransformOrigin="0.5,0.5">
<Path.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="-19.995"/>
<TranslateTransform/>
</TransformGroup>
</Path.RenderTransform>
</Path>
<Path x:Name="p3" Data="M177,107 L179.5,119.5" Fill="White" HorizontalAlignment="Left" Height="33.5" Margin="61 43 0 0" Stretch="Fill" Stroke="#41C236" StrokeThickness="3" VerticalAlignment="Top" Width="10"/>
<Path x:Name="p4" Data="M185,138 L192.5,124" Fill="White" HorizontalAlignment="Left" Height="17" Margin="69 58 0 0" Stretch="Fill" Stroke="#41C236" StrokeThickness="3" VerticalAlignment="Top" Width="10.5"/>
<Path x:Name="p5" Data="M190,124 L200,124" Fill="White" HorizontalAlignment="Left" Height="3" Margin="74 60 0 0" Stretch="Fill" Stroke="#41C236" StrokeThickness="3" VerticalAlignment="Top" Width="13"/>

</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Trigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource Storyboard1}"/>
</Trigger.EnterActions>

</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

style

posted on   ExplorerMan  阅读(254)  评论(0编辑  收藏  举报

编辑推荐:
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
阅读排行:
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 【自荐】一款简洁、开源的在线白板工具 Drawnix

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示