【发布时间】:2012-09-03 16:52:36
【问题描述】:
标题几乎概括了它。我遇到了 ColorAnimation 无法正常工作的问题。我最终发现 TargetProperty 必须用括号括起来......虽然我不完全明白为什么?
有什么想法吗? (特别注意:Storyboard.TargetProperty=") 为什么一定要放在括号里?
<Style.Resources>
<ColorAnimation x:Key="RecordingAnimation" Storyboard.TargetProperty="(Background).(SolidColorBrush.Color)" From="White" To="Blue" Duration="0:0:0.5" AutoReverse="True" RepeatBehavior="Forever"/>
<ColorAnimation x:Key="StopRecordingAnimation" Storyboard.TargetProperty="(Background).(SolidColorBrush.Color)" To="White" Duration="0:0:0.1"/>
</Style.Resources>
【问题讨论】:
-
Scope 看起来像是一个合理的答案.. Background.SolidColorBrush.Color 在上下文中可能没有任何意义,因为颜色是 SolidColorBrush 的属性.. 但不是 BackGround.SolidColorBrush .. 所以分离是( ) 是这里限制属性范围的方式
标签: .net wpf xaml datatrigger coloranimation