Wpf binding not updating propertychanged
So, based on the change in first name and last name, we have to automatically update the full name.
In the previous article we saw how changes in a Text Box was not immediately sent back to the source.
Take one WPF Window in which there are a total of three fields: First Name, Last Name and Full Name.
Here, first name and last name text boxes are editable.
As you can see, each of the three textboxes now uses a different Update Source Trigger.
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.
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!
Default is, obviously, the default value of the Update Source Trigger.