【发布时间】:2014-07-20 23:09:44
【问题描述】:
我有一个DataTrigger,它在网格行上为Background.Color 设置动画。当Background 是SolidColorBrush 类型时,它工作得很好,因为它有一个Color 属性。
但是,当突出显示该网格行时,背景变为LinearGradientBrush,其中does not have a Color 属性和我的故事板失败并出现异常。我该如何处理?
这是我的触发器
<DataTrigger Binding="{Binding Row.State}" Value="Finished">
<DataTrigger.EnterActions>
<BeginStoryboard>
<Storyboard >
<ColorAnimation
Storyboard.TargetProperty="Background.(Color)"
To="LightGreen" Duration="0:0:1" />
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
</DataTrigger>
这是突出显示行时出现的异常。
附加信息:无法解析属性路径“背景。(颜色)”中的所有属性引用。验证适用的对象是否支持这些属性。
【问题讨论】:
标签: wpf binding storyboard wpf-animation coloranimation