views:

389

answers:

1

Hi All,

There is a lot of talk about the simplicity of Visual States and the transitions between them in WPF/Silverlight.

I have the need to generate animations dynamically at runtime, to animate the rotation of a 3D model (depending on the users mouse interaction, I want to rotate the 3D model around its axis).

I have been generating an Animation at runtime and animating the model, just fine, but it feels wrong to me... I was wondering if anyone out there thinks that creating visual states at runtime would be a better alternative?

Cheers, Mark

+2  A: 

I don't think this is a suitable use for Visual States. My understanding is that they are the distinct states that an object can have - a button is "normal", "focused", "pressed", "hovered over" etc. and the Visual State Manager (VSM) controls the transitions between these states.

In your case you are animating something that can have an infinite number of states - one view for every conceivable viewpoint on your model. I don't think the VSM will be particularly efficient in this case.

ChrisF
I actually suspected as much, thanks
Mark