【问题标题】:VisualStateManager.GoToState for FrameworkElementFrameworkElement 的 VisualStateManager.GoToState
【发布时间】:2012-04-18 16:43:43
【问题描述】:

我在用VisualStateManager 为StackPanel 设置动画时遇到了麻烦。

VisualStateManager.GoToState() 接受Control 作为参数,但StackPanel 的类型为UIElement/FrameworkElement。

如何通过StackPanel 拨打VisualStateManager.GoToState()?

【问题讨论】:

    标签: c# silverlight windows-phone-7 silverlight-3.0 frameworkelement


    【解决方案1】:

    你可以使用VisualStateManager.GoToElementState

    这篇文章可能对您有所帮助:WPF using VisualStateManager to animate panels in & out。

    编辑:

    上述方法仅适用于 WPF,在 Silverlight 中不可用。对于 Silverlight,Blend SDK 中的 ExtendedVisualStateManager 可能会有所帮助:

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

    不过,您必须包含 Microsoft.Expression.Interactions 程序集。

    【讨论】:

    • 再次感谢,我看了那个帖子,这在wp7中不起作用,方法没有定义
    • 对不起,我不明白。你使用表情混合吗?有一个 ExtendedVisualStateManager 类似乎确实有 Silverlight 的 GoToElementState。
    • 在 Silverlight 的 Blend SDK 中
    • 天哪,事情越来越难了。我不会在不到一年的时间里自己找到那个解决方案......:S
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-08-17
    • 2021-07-22
    • 2011-11-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多