• WPF里的报警闪烁效果


    <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>

  • 相关阅读:
    day 38
    day 37
    day 36
    day 35
    day 34
    day 33
    day 32
    day 31
    day 30
    day 29
  • 原文地址:https://www.cnblogs.com/Robert-huge/p/5902389.html
Copyright © 2020-2023  润新知