i am moving from AS3 and Java to Expression Blend/WPF, but cant seem to figure out how to replicate EnterFrame
event in C#, is there a update()
or frameUpdate()
function.
views:
10answers:
2
+1
Q:
Is there an equivalent of EnterFrame event in Expression Blend/WPF, If not how do we get around it?
A:
CompositionTarget.Rendering is called every frame. You could also use timer such as DispatcherTimer.
Kris
2010-08-31 14:35:27
+1
A:
this should be helpful: http://www.shinedraw.com/mathematics/difference-on-timer-enter-frame-dispatcher-timer-and-composition-target/
and this too
http://insideria.com/2009/01/scripted-animation-in-silverli.html
Eugene
2010-08-31 14:51:49
+1, Silverlight handles animation very differently from Flash - arguably, more efficiently, but makes some tasks harder than in AS. Storyboards should be the way to go; however, even in Flash, framerate dependent scripting shouldn't be used unless it really is suitable for the task, and you don't care about the _actual_ time spent each frame, because it _will_ be variable. Silverlight disposes of this problem altogether by enforcing (to some extent) time-based animation/scripting.
Alex Paven
2010-09-01 08:44:10