Reputation: 21863
how can i assing static or dynaimc resource to animation. Eg how can i assign a brush resource to From or To property of ColorAnimation.
Upvotes: 0
Views: 244
Reputation: 24453
ColorAnimation operates on Color objects, not Brush objects. If you're trying to use SolidColorBrush resources you can just change them to Color or change the brushes to reference new Color objects. Change:
<SolidColorBrush x:Key="MyBrush" Color="Red"/>
to
<Color x:Key="MyColor">Red</Color>
<SolidColorBrush x:Key="MyBrush" Color="{StaticResource MyColor}"/>
To="{StaticResource MyColor}"
Upvotes: 1