I have a class called MyUser. It contains a public property "Image" as follows
private ImageSource _Image;
public ImageSource Image
{
get { return _Image; }
set
{
if (value != _Image)
{
_Image = value;
OnPropertyChanged("Image");
}
}
}
I have a WPF UserControl that contains a setter to fill a path with that user's image. (User is a MyUser object from the ViewModel)
<Setter Property="Fill">
<Setter.Value>
<ImageBrush ImageSource="{Binding Path=User.Image}"
Stretch="UniformToFill" />
</Setter.Value>
</Setter>
I am getting an error during runtime (not an exception)
System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:Path=User.Image; DataItem=null; target element is 'ImageBrush' (HashCode=21084988); target property is 'ImageSource' (type 'ImageSource')
The image is showing up perfectly fine. Why am I getting this error? Is this something I should be concerned about?
Thanks for all your help! Mo