VisualStateManager.GoToState for FrameworkElement

Go To StackoverFlow.com

4

I have troubles animating a StackPanel with the VisualStateManager.

VisualStateManager.GoToState() accepts a Control as parameter, but StackPanel is of type UIElement/FrameworkElement.

How can I call VisualStateManager.GoToState() on a StackPanel?

2012-04-04 22:31
by thumbmunkeys


4

You can use VisualStateManager.GoToElementState

This post might help you: WPF using VisualStateManager to animate panels in & out.

Edit:

The methods above are only for WPF and not available in Silverlight. For Silverlight the ExtendedVisualStateManager from the Blend SDK might be helpful:

http://msdn.microsoft.com/de-de/library/microsoft.expression.interactivity.core.extendedvisualstatemanager.gotoelementstate(v=expression.40).aspx

You would have to include the Microsoft.Expression.Interactions assembly though.

2012-04-04 22:50
by aKzenT
thanks, but unfortunately this method is not defined in silverlight/wp7.. - thumbmunkeys 2012-04-04 22:52
thanks again, I looked at that post, this doesnt work in wp7, the method is not define - thumbmunkeys 2012-04-04 22:55
sorry, I don't realize. Do you use expression blend? there is the ExtendedVisualStateManager class that does seem to have the GoToElementState for silverlight - aKzenT 2012-04-04 22:58
http://msdn.microsoft.com/de-de/library/microsoft.expression.interactivity.core.extendedvisualstatemanager.gotoelementstate(v=expression.40).asp - aKzenT 2012-04-04 22:58
in the Blend SDK for silverligh - aKzenT 2012-04-04 22:59
cheers, that class has the right method - thumbmunkeys 2012-04-04 23:03
Oh man, things are getting harder. I wouldn't find that solution by myself in less than one year ... : - Ignacio Soler Garcia 2013-06-01 19:02
Ads