给定由 VisualStateManager 作为 ControlTemplate 的一部分启动的 Storyboard,我将如何根据控件的属性更改调整该动画的 SpeedRatio?
<ControlTemplate>
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup>
<VisualState>
<Storyboard Name="SpinningThing"
SpeedRatio="{Binding SpinningSpeedRatio}">
...
这需要在 WPF 和 Silverlight 中都有效。
由于多种原因,我认为我不能在那里设置绑定。最重要的是,Storyboard 是可冻结的,因此您不能在 WPF 中随意设置 SpeedRatio。但是,如果它是由 VisualStateManager 启动的,我可以在它上面调用 SetSpeedRatio 吗?
此外,由于它的父级是 VisualState,这是否意味着没有与之相关的管理 FrameworkElement ?
那么,如果我不能用绑定来做到这一点,怎么能做到呢?