Wpf oneway binding not updating

They are valid only for one-way and two-way bindings.

So although I was firing an event that looked like INotify Property Changed.

Property Changed, I was actually just firing my own event with the same name 🙂 So there you have it, I’m an idiot 🙂 The moral of the story is, when your bindings aren’t working check the obvious: Hello there!

Normally my View Models inherit from my View Model Base base class, which provides a Raise Property Changed method and, when in debug mode, uses reflection to check if the property name is valid.

Now I’d recently refactored the code so this particular View Model wasn’t using the base class, so my first instinct was that I’d simply mistyped the property name magic string in the event – but that was all fine.

However, changing the text in the one-way bound text box does not update the source, so the other controls remain unchanged.

For the third box we'll use one way to source binding mode: The new binding has several effects.

I threw in a few breakpoints and I could see my View Model was changing, I could see the On Property Changed method being hit, but there didn’t seem to be any listeners and as a result my UI was just ignoring the changes.

After a few minutes of head scratching I noticed that although my class was firing the Property Changed event correctly, I hadn’t added INotify Property Changed to my class declaration when I removed the base class!

We'll use the One Time binding for the fourth Text Box.

Tags: , ,