Tuesday, 20 August 2013

Cannot find governing FrameworkElement or FrameworkContentElement for target element. GradientStop

Cannot find governing FrameworkElement or FrameworkContentElement for
target element. GradientStop

I have a list box contains Colors and Each Color have 7 Heads it is to
choose Print Head for Color. so my Binding variable is when print head is
selected , Color box should have this Styles.
<Setter TargetName="colorSelectionRectangle" Property="Fill">
<Setter.Value>
<LinearGradientBrush SpreadMethod="Repeat" StartPoint="0,0"
EndPoint="25,25">
<LinearGradientBrush.RelativeTransform>
<ScaleTransform ScaleX="0.01" ScaleY="0.01" />
</LinearGradientBrush.RelativeTransform>
<GradientStop Offset="0" Color="White" />
<GradientStop Offset="0.5" Color="White" />
<GradientStop Offset="0.5" Color="{Binding
[0].Item.PrintColor.Argb}" />
<GradientStop Offset="1" Color="{Binding
[0].Item.PrintColor.Argb}" />
</LinearGradientBrush>
</Setter.Value>
and My error is :
System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or
FrameworkContentElement for target element.
BindingExpression:Path=[0].Item.PrintColor.Argb; DataItem=null; target
element is 'GradientStop' (HashCode=52327179); target property is 'Color'
(type 'Color')

No comments:

Post a Comment