Wpf binding not updating propertychanged

Posted by / 08-Mar-2020 22:23

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!

wpf binding not updating propertychanged-15wpf binding not updating propertychanged-84wpf binding not updating propertychanged-78

Default is, obviously, the default value of the Update Source Trigger.

One thought on “wpf binding not updating propertychanged”

  1. We don’t find anything romantic about name tags, microphones and whistles – so we don’t use them! Daters that don’t like to settle and tend to set the trend rather than follow it. You will be sent a confirmation from us and your name will be noted on our Guest List.~~Do you screen your speed daters?