我有代码:绑定值不正常工作
<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background). (GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="grid">
<EasingColorKeyFrame KeyTime="0:0:0.5" Value="{Binding CorBackground}"/>
</ColorAnimationUsingKeyFrames>
颜色值定义为Value="#FFFFFF"
,我会想使用绑定来定义这个颜色。 Value="{Binding CorBackground}
。这是可能的?
我创建一个MainWindow.xaml.cs
财产,但不工作:
private string _corBackground = string.Empty;
public string CorBackground
{
get { return _corBackground; }
set { _corBackground = value; }
}