Partially update WPF animation in storyboards / ParallelTimelines without new Begin ()?

I am working on a WPF application that displays a series of graphics elements (RectangleGeometries and Splines) that animate in sync with the video being displayed in the MediaElement.

The sync tree is structured as follows:

  • Storyboard (for controls: Begin (), Pause (), Seek () ...)
    • MediaTimeline (connected to MediaElement using Storyboard.SetTargetName ())
    • ParallelTimeline 0 (subdivided into ParallelTimelines for easier object management)
      • KeyframeAnimation 0 (animates some graphic element)
      • KeyframeAnimation 1 (animating another graphic)
      • ...
    • ... (maybe more ParallelTimelines ...)

Due to the dynamic nature of the displayed and animated elements, this is all created and managed in code, i.e. no XAML. Setting it up and playing, searching, etc. Works great.

The problem I am facing is as follows.

Animated elements can be updated (e.g. KeyFrames animations are updated, added, removed, ...) from time to time while the video is still displayed, although it may be paused. Simply updating the original animation has no effect as Freezable copies of all animations appear to be used while the Storyboard is playing (looking at the source code, this freezing seems to happen in the Begin () method when the clock is allocated and applied animation to Dependency Properties). I tried to make my animations unaffected (CanFreeze = false), but that just throws exceptions without playing anything.

Is there a way to update only some of the animations (e.g. only ParallelTimeline 0 and children) without causing the entire Storyboard to be reset and not interrupting sync with the original MediaTimeline, or forcing the MediaTimeline to reload (which involves reloading and re-searching the associated media and causing a significant delay) ?

+2
c # .net animation wpf


source to share


No one has answered this question yet

Check out similar questions:

201
How do I get an animated gif to work in WPF?
179
Automapper: update property values ​​without creating a new object
ten
How to easily change the runtime of an infinite animation (in CSS3) using Javascript
2
WPF animated animation not flashing
2
How do I get my Silverlight animation / app to work the same as it does in WPF?
2
Programmatically Create a Storyboard in WPF ControlTemplate
2
WPF MediaElement - Image won't refresh when video is paused and position is reset
1
Reset storyboard animation in wpf
0
XAML Storyboard - Looping Keyframe
0
WPF MediaElement video won't play after hiding in storyboard



All Articles
Loading...
X
Show
Funny
Dev
Pics