码迷,mamicode.com
首页 > Windows程序 > 详细

WPF里的报警闪烁效果

时间:2016-09-24 09:17:44      阅读:1562      评论:0      收藏:0      [点我收藏+]

标签:

<esri:MarkerSymbol x:Key="FlashMarkerSymbol" OffsetX="41" OffsetY="41">
<esri:MarkerSymbol.ControlTemplate>
<ControlTemplate>
<Grid Height="81" Width="81">
<Grid.Resources>
<Style TargetType="{x:Type Line}">
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Stroke" Value="Red"/>
<Setter Property="StrokeThickness" Value="1"/>
</Style>
</Grid.Resources>
<Ellipse x:Name="elp1">
<Ellipse.Fill>
<RadialGradientBrush>
<GradientStop Color="#F00" Offset="1"/>
<GradientStop Color="#0FB2" Offset="0"/>
</RadialGradientBrush>
</Ellipse.Fill>
</Ellipse>
<Ellipse Fill="White" Height="11" Stroke="#000" StrokeThickness="1" StrokeDashArray="5,2.95" StrokeDashOffset="6.7" Width="11"/>
<Line X1="31" Y1="40.5" X2="38" Y2="40.5"/>
<Line X1="43" Y1="40.5" X2="50" Y2="40.5"/>
<Line X1="40.5" Y1="31" X2="40.5" Y2="38"/>
<Line X1="40.5" Y1="43" X2="40.5" Y2="50"/>
<Ellipse x:Name="elp2" Cursor="Hand" Height="9" Width="9">
<Ellipse.Fill>
<RadialGradientBrush>
<GradientStop Color="#F00" Offset="1"/>
<GradientStop Color="#FD9" Offset="0"/>
</RadialGradientBrush>
</Ellipse.Fill>
</Ellipse>
</Grid>
<ControlTemplate.Triggers>
<EventTrigger RoutedEvent="FrameworkElement.Loaded" SourceName="elp2">
<BeginStoryboard>
<Storyboard RepeatBehavior="Forever">
<DoubleAnimation Storyboard.TargetName="elp1" Storyboard.TargetProperty="Width" From="10" To="80" Duration="0:0:1.5"/>
<DoubleAnimation Storyboard.TargetName="elp1" Storyboard.TargetProperty="Height" From="10" To="80" Duration="0:0:1.5"/>
<DoubleAnimation Storyboard.TargetName="elp1" Storyboard.TargetProperty="Opacity" From="0.9" To="0" Duration="0:0:1.5"/>
<DoubleAnimation Storyboard.TargetName="elp2" Storyboard.TargetProperty="Opacity" From="0.3" To="1" Duration="0:0:1.5"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>

</esri:MarkerSymbol.ControlTemplate>
</esri:MarkerSymbol>

WPF里的报警闪烁效果

标签:

原文地址:http://www.cnblogs.com/Robert-huge/p/5902389.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!