我有代碼:綁定值不正常工作
<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; }
}