以下代码在运行时运行并完美运行,但崩溃了设计器,我不明白为什么.
<VisualState x:Name="Selected" >
<Storyboard>
<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(TextElement.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="HeaderTopSelected">
<EasingColorKeyFrame KeyTime="0" Value="White"/>
</ColorAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
Run Code Online (Sandbox Code Playgroud)
这会使设计器崩溃,并出现以下错误:
'System.Windows.Media.Animation.ColorAnimationUsingKeyFrames'动画对象不能用于动画属性'Foreground',因为它是不兼容的类型'System.Windows.Media.Brush'
我一直试图解决这个问题几个小时,我只是不知道为什么这个崩溃设计师考虑到这个例子在网上很多次显示并在运行时工作.
谁能告诉我我做错了什么?
谢谢!