ArrangeOverride Vs Storyboard Animation
Posted
by user275561
on Stack Overflow
See other posts from Stack Overflow
or by user275561
Published on 2010-04-08T21:38:42Z
Indexed on
2010/04/08
21:43 UTC
Read the original article
Hit count: 355
Silverlight
|mvvm
Now I may not grasp the idea or this could be a mistake so feel free to correct me. I am doing a bubble breaker game in Silverlight. So when a bubble in a column gets bursted. I want to animate the above bubbles to simulate that they are being dropped. Each bubble knows its Row and column location and that gets updated in the View Model. Now my question is, Should I call invalidateArrange() on the Canvas from the ViewModel so it rearranges the bubbles or just have a storyboard animate the TranslateY.
In my arrangeOverride Method I have something like this
Rect childBounds = new Rect(CalculateLeft(dataContext.Column), CalculateTop(dataContext.Row), BubbleSize, BubbleSize);
child.Arrange(childBounds);
If there is a better way let me know. I am trying to learn the best practices.
© Stack Overflow or respective owner