Note that there are some explanatory texts on larger screens.

plurals
  1. POWPF: What can cause a binding source to not be updated?
    text
    copied!<p>I have a situation I'm not sure how to debug. I'm hoping someone can suggest why it might not be working and point me in the right direction.</p> <p>I have a TIFF image from a database which is exposed as a property of type <code>System.Data.Linq.Binary</code>. I want to display the individual frames from that TIFF image in an <code>ItemsControl</code> so I've written a converter that takes the Binary datatype and returns an <code>ObservableCollection</code> of BitmapFrames. I'm binding <code>ItemsControl.ItemsSource</code> to the Binary property using the converter along with <code>"Mode=TwoWay"</code> and <code>"UpdateSourceTrigger=PropertyChanged"</code>.</p> <p>The display of the images is working fine. The problem is that if I add a frame to the collection the display updates, but that change is not transferred back to the Binary property in the source object. The <code>ConvertBack()</code> method in my converter is never called (indicating to me that the binding is never even trying to update the source). If I manually make a call to <code>BindingExpression.UpdateSource()</code> as if it were set for <code>"UpdateSourceTrigger=Explicit"</code> the Binary property does update correctly.</p> <p>So if a binding is set for <code>"Mode=TwoWay"</code> and <code>"UpdateSourceTrigger=PropertyChanged"</code> and the object implements <code>INotifyPropertyChanged</code> (which <code>ObserverableCollection</code> does), why doesn't the binding actually try to update the source?</p> <p>Thanks!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload