Animate path StrokeDashOffset
Posted: 14 Oct 2016, 15:43
Hi,
I fail to animate StrokeDashOffset of a path - nothing happens when I start the storyboard below (no errors).
If I change the target propery:
then the thickness is animated, but I cannot animate StrokeDashOffset.
Is there something wrong with the example below:
Thanks in advance!
I fail to animate StrokeDashOffset of a path - nothing happens when I start the storyboard below (no errors).
If I change the target propery:
Code: Select all
Storyboard.TargetProperty="(Shape.StrokeDashOffset)"
to
Storyboard.TargetProperty="(Shape.StrokeThickness)"
Is there something wrong with the example below:
Code: Select all
<Storyboard RepeatBehavior="Forever" x:Name="animRotate">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.StrokeDashOffset)" Storyboard.TargetName="pathCursor">
<LinearDoubleKeyFrame KeyTime="0:0:0.5" Value="-6" />
</DoubleAnimationUsingKeyFrames>
</Storyboard>
....
<Canvas x:Name="panelCursor" >
<Path x:Name="pathCursor" StrokeThickness="3" Stroke="Gray" StrokeDashArray="4,3">
<Path.Data>
<GeometryGroup>
<EllipseGeometry Center="100, 100" RadiusX="40" RadiusY="40" />
</GeometryGroup>
</Path.Data>
</Path>
</Canvas>