<分区>
以下代码在运行时运行并完美运行,但使设计器崩溃,我不知道为什么。
<VisualState x:Name="Selected" >
<Storyboard>
<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(TextElement.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="HeaderTopSelected">
<EasingColorKeyFrame KeyTime="0" Value="White"/>
</ColorAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
这会使设计器崩溃并出现以下错误:
'System.Windows.Media.Animation.ColorAnimationUsingKeyFrames' animation object cannot be used to animate property 'Foreground' because it is of incompatible type 'System.Windows.Media.Brush'
几个小时以来,我一直在努力解决这个问题,我只是不知道为什么考虑到这个例子在网上多次显示并在运行时工作,这会让设计人员崩溃。
谁能告诉我我做错了什么?
谢谢!