I have a custom Class that implements INotifyPropertyChanged as follows (extraneous and repeated properties removed):
Public Class Map
Implements INotifyPropertyChanged
Private _wages As Decimal
Property Wages As Decimal
Get
Return _wages
End Get
Set(value As Decimal)
Debug.Print("Event Raised: " & _wages & " " & value)
_wages = value
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(Wages))
End Set
End Property
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
The Class is being Serialized/Deserialized correctly. When I load the XML file the TextBox that displays wages is not updating to reflect the Wages value.
I have the (Devexpress) TextBox DataBindings set with:
txtWages.DataBindings.Add(New Binding("EditValue", mymap, "Wages", False, DataSourceUpdateMode.OnPropertyChanged))
When I load the file I can see the old and new value from Debug.Print:
Event Raised: 0 13
However, txtWages stays as 0
I have read these answers Here and Here and tried to look for ideas but I am out of ideas.
EDIT: It seems that if I populate the class with the Deserialized XML and then set the Bindings it works, but not when the bindings are set first. I would have thought it would work either way.