我知道故事板在所有可冻结性方面都很棘手,但有可能与多个故事板共享动画吗?以下是我正在尝试做的事情:
<UserControl.Resources>
<Storyboard x:Key="SharedAnimation" />
</UserControl.Resources>
...
<VisualState Name="Animation1">
<Storyboard SpeedRatio="1">
<Somehow include SharedAnimation />
</Storyboard>
</VisualState>
<VisualState Name="Animation2">
<Storyboard SpeedRatio="1.5">
<Somehow include SharedAnimation />
</Storyboard>
</VisualState>
...
答案 0 :(得分:0)
我没有在这里尝试,因为我目前在这台机器上没有VS,但这可能有效:
<VisualState Name="Animation1">
<Storyboard SpeedRatio="1">
<StaticResource ResourceKey="SharedAnimation" />
</Storyboard>
</VisualState>