我有麻煩動畫與VisualStateManager
。VisualStateManager.GoToState for FrameworkElement
VisualStateManager.GoToState()
接受Control
作爲參數,但StackPanel
的類型爲UIElement
/FrameworkElement
。
如何在StackPanel
上撥打VisualStateManager.GoToState()
?
我有麻煩動畫與VisualStateManager
。VisualStateManager.GoToState for FrameworkElement
VisualStateManager.GoToState()
接受Control
作爲參數,但StackPanel
的類型爲UIElement
/FrameworkElement
。
如何在StackPanel
上撥打VisualStateManager.GoToState()
?
您可以使用VisualStateManager.GoToElementState
這篇文章可以幫助你:WPF using VisualStateManager to animate panels in & out。
編輯:
上述方法僅適用於WPF和Silverlight中不可用。對於Silverlight的從混合SDK的ExtendedVisualStateManager
可能會有所幫助:
你將不得不雖然包括Microsoft.Expression.Interactions
組裝。
謝謝,但不幸的是,這種方法沒有在silverlight/wp7中定義... – thumbmunkeys 2012-04-04 22:52:51
再次感謝,我看着那個帖子,這不工作在wp7中,方法沒有定義 – thumbmunkeys 2012-04-04 22:55:55
對不起,我沒有意識到。你用表情混合?有一個ExtendedVisualStateManager類似乎擁有用於silverlight的GoToElementState。 – aKzenT 2012-04-04 22:58:19