I have an ellipse like this:
<Ellipse Width="40" Height="50" Fill="Green">
<Ellipse.RenderTransform>
<RotateTransform Angle="0" CenterX="20" CenterY="25" />
</Ellipse.RenderTransform>
<Ellipse.Triggers>
<EventTrigger RoutedEvent="Ellipse.Loaded" >
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="RenderTransform.Angle"
From="0" To="360" Duration="{Binding Path=Dudu}" RepeatBehavior="Forever" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Ellipse.Triggers>
</Ellipse>
I want the ellipse rotate with speed depend on the Dudu
property (this property use INotifyPropertyChanged
to notify changed).
But duration is not changed when I change value of Dudu
. I figured out the problem is Loaded
event just raise on first time control is loaded only.
My question is: How can I change duration by change value of a property? What event should I use?