Вопрос

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?

Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top