WPF animation makes this very easy. Here is the basic technique:
Create the visual appearance of the ellipse using any WPF features that you like (shapes, paths, geometry, brushes, drawings, images, etc.). It can be a simple ellipse or a fancy drawing created by your graphic designer or something in between.
Apply an OpacityMask consisting of a wide elliptical dashed line with a dash with zero length. Since the dash is zero length, the entire ellipse in the normal style will be invisible.
. ( ), . 0 1, , , , , .
ControlTemplate:
<ControlTemplate TargetType="MyCustomControl">
<Grid>
<Rectangle Fill="{StaticResource EllipseVisualAppearance}">
<Rectangle.OpacityMask>
<VisualBrush>
<VisualBrush.Visual>
<Ellipse
x:Name="opacityEllipse"
StrokeDashArray="0 10"
Stroke="Black" StrokeThickness="0.5"
Width="1" Height"1" />
</VisualBrush.Visual>
</VisualBrush>
</Rectangle.OpacityMask>
</Rectangle>
<ContentPresenter />
</Grid>
</ControlTemplate>
WPF , - , , .
, , WPF. , " " , ( ) - , :
- , , , , .
- , , , , , , .
- Expression Design ( Adobe Illustrator), XAML.
- ( , ).
- Expression Blend
:
<VisualBrush x:Key="EllipseVisualAppearance">
<VisualBrush.Visual>
<Ellipse StrokeThickness="0.1" Stroke="Blue" />
</VisualBrush.Visual>
</VisualBrush>
, , , , . 0 360 DoubleAnimation , :
<DoubleAnimation
StoryBoard.TargetName="opacityEllipse"
StoryBoard.TargetProperty="StrokeDashArray[0]"
From="0" To="3.1416" Duration="0:0:0.5" />
3.1416 pi, 1. , .
StackOverflow , , . , . PathGeometry ArcSegment. , , , , -, .