I create an animation like this:
private DoubleAnimation BusyGettingNewOrders = new DoubleAnimation(40, TimeSpan.FromSeconds(1));
And start it with this.
BusyGettingNewOrders.RepeatBehavior = new RepeatBehavior(1000);
BusyGettingNewOrders.To = 40;
BusyGettingNewOrders.Duration = TimeSpan.FromSeconds(1);
GetNewOrdersImage.BeginAnimation(Button.WidthProperty, BusyGettingNewOrders);
I need to stop it after a long running process ends. I tried the following, but although it executes, it has no effect. The animation continues to run.
BusyGettingNewOrders.RepeatBehavior = new RepeatBehavior(1);
Ideas?