josephdaviskcrm
asked on
Silverlight 2 Point animation
I'm working with animation in Silverlight 2 and am able to get some stuff working, but I am having problems trying to animate a polygon object's points. I've got a polygon with four points...
<Polygon x:Name="poly1"
MouseLeftButtonDown="poly1 _MouseLeft ButtonDown "
Points="100,100 200,100 200,200 100,200"
Stroke="Blue"
StrokeThickness="2">
<Polygon.Fill>
<SolidColorBrush Color="LightBlue"></SolidC olorBrush>
</Polygon.Fill>
<Polygon.RenderTransform>
<RotateTransform CenterX="150" CenterY="150" Angle="0" />
</Polygon.RenderTransform>
</Polygon>
I am trying to alter the 4 points of the polygon so that it changes into a different shape, size, and location. In the following code, all of the animations work perfectly except for the last one that deals with the points. I have tried to use PointAnimation instead of DoubleAnimation but it still throws an error when loading the silverlight object.
<Storyboard x:Name="myStoryBoard">
<DoubleAnimation
Storyboard.TargetName="pol y1"
Storyboard.TargetProperty= "Opacity"
From="1.0" To="0.0" Duration="0:0:2"
AutoReverse="True" RepeatBehavior="Forever" />
<ColorAnimation
Storyboard.TargetName="pol y1"
Storyboard.TargetProperty= "(Polygon. Fill).(Sol idColorBru sh.Color)"
From="LightBlue" To="Red" Duration="0:0:5" AutoReverse="True" RepeatBehavior="Forever" />
<DoubleAnimation
Storyboard.TargetName="pol y1"
Storyboard.TargetProperty= "(Polygon. RenderTran sform).(Ro tateTransf orm.Angle) "
From="0.0" To="90.0" Duration="0:0:5" AutoReverse="False" RepeatBehavior="Forever" />
<DoubleAnimation
Storyboard.TargetName="pol y1"
Storyboard.TargetProperty= "Points"
From="100,100 200,100 200,200 100,200" To="100,300 200,300 300,200 300,200" Duration="0:0:5" AutoReverse="True" RepeatBehavior="Forever" />
Any ideas?
<Polygon x:Name="poly1"
MouseLeftButtonDown="poly1
Points="100,100 200,100 200,200 100,200"
Stroke="Blue"
StrokeThickness="2">
<Polygon.Fill>
<SolidColorBrush Color="LightBlue"></SolidC
</Polygon.Fill>
<Polygon.RenderTransform>
<RotateTransform CenterX="150" CenterY="150" Angle="0" />
</Polygon.RenderTransform>
</Polygon>
I am trying to alter the 4 points of the polygon so that it changes into a different shape, size, and location. In the following code, all of the animations work perfectly except for the last one that deals with the points. I have tried to use PointAnimation instead of DoubleAnimation but it still throws an error when loading the silverlight object.
<Storyboard x:Name="myStoryBoard">
<DoubleAnimation
Storyboard.TargetName="pol
Storyboard.TargetProperty=
From="1.0" To="0.0" Duration="0:0:2"
AutoReverse="True" RepeatBehavior="Forever" />
<ColorAnimation
Storyboard.TargetName="pol
Storyboard.TargetProperty=
From="LightBlue" To="Red" Duration="0:0:5" AutoReverse="True" RepeatBehavior="Forever" />
<DoubleAnimation
Storyboard.TargetName="pol
Storyboard.TargetProperty=
From="0.0" To="90.0" Duration="0:0:5" AutoReverse="False" RepeatBehavior="Forever" />
<DoubleAnimation
Storyboard.TargetName="pol
Storyboard.TargetProperty=
From="100,100 200,100 200,200 100,200" To="100,300 200,300 300,200 300,200" Duration="0:0:5" AutoReverse="True" RepeatBehavior="Forever" />
Any ideas?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.