我在 WPF 中有一个自定义按钮。在禁用状态下,我希望它的内容颜色发生变化,但我无法做到这一点。我正在使用 Blend for Visual Studio。当我去编辑模板并选择 contentPresente 的画笔颜色时,它说该值无效。我怎样才能做到这一点 ?我试图在 XAML 中更改它,这是我使用的代码,但有一个错误。
<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="contentPresenter">
<EasingColorKeyFrame KeyTime="0" Value="Black" />
</ColorAnimationUsingKeyFrames>