Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 429821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T19:48:48+00:00 2026-05-12T19:48:48+00:00

I have a situation I’m not sure how to debug. I’m hoping someone can

  • 0

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.

I have a TIFF image from a database which is exposed as a property of type System.Data.Linq.Binary. I want to display the individual frames from that TIFF image in an ItemsControl so I’ve written a converter that takes the Binary datatype and returns an ObservableCollection of BitmapFrames. I’m binding ItemsControl.ItemsSource to the Binary property using the converter along with "Mode=TwoWay" and "UpdateSourceTrigger=PropertyChanged".

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 ConvertBack() 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 BindingExpression.UpdateSource() as if it were set for "UpdateSourceTrigger=Explicit" the Binary property does update correctly.

So if a binding is set for "Mode=TwoWay" and "UpdateSourceTrigger=PropertyChanged" and the object implements INotifyPropertyChanged (which ObserverableCollection does), why doesn’t the binding actually try to update the source?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T19:48:48+00:00Added an answer on May 12, 2026 at 7:48 pm

    This is happening because for TwoWay bindings, WPF only detects when the property gets a new value, not when an object referenced by the property changes.

    In your case your property contains the ObservableCollection created by your converter. Although the contents of the ObservableCollection has been modified, and it fires INotifyPropertyChanged, the bound property itself has not changed: It still refrences the same ObservableCollection as before. Because of this, WPF DataBinding is not triggered and your source is not updated.

    When you call UpdateSource() manually, it forces the ObservableCollection to be passed through your converter and back to your data object, so it works.

    The easiest way to get the behavior you desire is:

    1. Instead of binding to the data field, bind to the data object, and extract the desired field in the converter (if you want to make a generic converter that can access any field, pass the field as a parameter).

    2. In the converter when you construct the ObservableCollection, add a CollectionChanged event that updates the original object whenever it fires.

    Here is the general idea in code:

      public MyConverter : IValueConverter
      {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
          PropertyInfo property = object.GetType().GetProperty((string)parameter);
    
          var coll = BinaryToCollection((Binary)property.GetValue(object, null));
    
          coll.CollectionChanged += (sender, e) =>
          {
            property.SetValue(object, CollectionToBinary(coll));
          };
          return coll;
        }
    
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
          throw new NotImplementedException();
        }
    
        private ObservableCollection<SomeType> BinaryToCollection(Binary data)
        {
          // conversion details here
        }
    
        private Binary CollectionToBinary(ObservableCollection<SomeType> coll)
        {
          // conversion details here
        }
    
      }
    

    In this case your binding would change from

     <ItemsControl ItemsSource="{Binding something.property, Mode=TwoWay, Converter={...}}"
    

    to

      <ItemsControl ItemsSource="{Binding something, Converter={...}}"
    

    with the converter parameter being the property name

    Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have situation where a user can manipulate a large set of data (presented
We have situation where say we have four engineers that are working on software
I have situation where I need to make sure that user has completed certain
I can't make git push origin B. I have situation something like this _____________________________________
i have situation like this: class IData { virtual void get() = 0; virtual
I have situation, where running a query that filters by an indexed column in
I have situation in which I read a record from a database. And if
I have situation where I need to change the order of the columns/adding new
I have situation like this: user submits form with action='/pay' in '/pay' I have
Pseudo-situation: have a class (let's say BackgroundMagic ), and it has Start() and Stop()

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.