Why doesn’t this work?
Some Usercontrol (name: myUserControl) with an image control (name: myImage):
UserControl.cs>
...
public ImageSource MyImageSource{get;set;}
...
UserControl.xaml.cs>
...
<Image Name="myImage" Stretch="Fill" Source="{Binding ElementName=myUserControl, Path=MyImageSource}" />
...
When i use this custom usercontrol and set the value of ‘MyImageSource’ (i can browse for an image).
But when i build and run, i see nothing.
Did i do the binding correctly?
The property needs to be implemented with
INotifyPropertyChangedor it has to be a dependency property, in a UserControl you usually use dependency properties.