Summary: Issues and workarounds for WPF.
Pausing and Resuming an Animation Does Not Work as Expected when DesiredFrameRate is SetTimeline objects with a
DesiredFrameRate value other than a null reference (Nothing in Visual Basic) do not pause and resume as expected.
An InvalidCastException occurs when clicking on a ListBoxItem/ComboBoxItem/TabItem after animating SelectedIndexClicking on a
ListBoxItem, ComboBoxItem, or
TabItem after animating the
SelectedIndex property of its
ListBox, ComboBox, or
TabControl container throws an
InvalidOperationException. Performance Impacts of HandoffBehavior.ComposeWhen you apply an animation to a property using the Compose
HandoffBehavior, any clocks objects previously associated with that property continue to consume system resources; the timing system will not remove these clocks automatically.
To avoid performance issues when you apply a large number of clocks using
HandofffBehavior.Compose, you should remove composing clocks from the animated property after they complete. There are several ways to remove a clock.
To remove all clocks from a property, use the
ApplyAnimationClock or
BeginAnimation method of the animation object. Specify the property being animated as the first parameter, and a null reference (Nothing in Visual Basic) as the second. This will remove all animation clocks from the property.
To remove a specific
AnimationClock from a list of clocks, use the Controller property of the
AnimationClock to retrieve a
ClockController, then call the
ClockController.Remove() method of the
ClockController. This is typically done in the Completed event handler for a clock. Note that only root clocks can be controlled by a
ClockController; the Controller property of a child Clock will return a null reference (Nothing in Visual Basic). Note also that the Completed event will not be called if the effective duration of the clock is forever. In that case, the user will need to determine when to call
ClockController.Remove(). This is primarily an issue for animations on objects that have a long lifetime. When an object is garbage collected, its clocks will also be disconnected and garbage collected.
Back to
WPF.HomePage