I have an Image control that is supposed to do a slide show.
Here are the binding I used to achieve this:
Binding mapBinding = new Binding();
mapBinding.Source = slideView;
mapBinding.Path = new PropertyPath("ImageDrawing");
sliderImage.SetBinding(System.Windows.Controls.Image.SourceProperty, mapBinding);
And a class SlideImage
public class SlideImage : INotifyPropertyChanged {
public ImageSource ImageDrawing{get;set;}
public void ChangeImage(){
// Load another image
// Update ImageDrawing
// Fire property changed event
}
public event PropertyChangedEventHandler PropertyChanged;
}
I found many examples on the net using the UpdateSourceTrigger to listen for data source changes. The only problem is the Image control does not have that property.
How do I hook up my sliderImage control to update on SlideImage.PropertyChanged?
It probably will update automatically, if you’re actually calling
PropertyChangedwhen calling the setter ofImageDrawing.You aren’t firing
PropertyChangedfor yourImageDrawingproperty in the code you’ve provided. Try this: