Can I reference Storyboard resources in XAML defind Visual States?
I have six different objects with their own Visual State Managers. The Focused state of each object is the same. I want to define a single Focused State Storyboard resource开发者_如何学C and reference it in each of the 6 Focus Visual states. Can this be done? Here's my code (all in the same UserControl.Resources):
<Storyboard x:Key="FocusedState">
...
</Storyboard>
In each of my 6 objects I have the following:
<VisualStateGroup x:Name="FocusStates">
<VisualState x:Name="Focused" Storyboard="{StaticResource FocusedState}"/>
...
When I run the project I get the following error:
Message: Attribute {StaticResource FocusedState} value is out of range.
It looks like it's not possible to use dynamic resource reference or binding to set Storyboard or Animation values in control templates. I found the answer and explanation on this post.
精彩评论