Control DataBindings do not update when using INotifyPropertyChanged.
See original GitHub issue- .NET Core Version: 3.0.100-preview3-010431
- Have you experienced this same bug with .NET Framework?: No
Problem description: Control bound to a property does not update when INotifyPropertyChanged is triggered. The same code works in Windows Forms on .Net Framework. Repro example below is for a label, but also tried with a button and saw the same issue.
Actual behavior: Bound control is not updated when the property is updated.
Expected behavior: Bound control should be updated when the property is updated.
Minimal repro:
-
Repro zipped for dowload here, includes projects for WinForms (Net Framework), WinForms (Net Core), and WPF (Net Core).
-
Create a Windows Forms (.Net Core) application.
-
Add a class with a property to bind to, example below:
public class TestController : INotifyPropertyChanged
{
private string simpleStringProperty;
public event PropertyChangedEventHandler PropertyChanged;
private void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
public TestController()
{
SimpleStringProperty = "hi";
}
public string SimpleStringProperty
{
get => simpleStringProperty;
set
{
simpleStringProperty = value;
OnPropertyChanged(nameof(SimpleStringProperty));
}
}
}
- Add code to form1 ctor
_controller = new TestController();
label1.DataBindings.Add("Text", _controller, nameof(_controller.SimpleStringProperty));
- Add a button and add following code to Click handler
_controller.SimpleStringProperty = "hello";
-
Run the application. The label is set to the initial value of
SimpleStringProperty, but when the button is clicked, the value is not updated. -
To compare to Windows Forms, carry out the above steps on a Windows Forms (.Net Framework) application and when the button is clicked, the label will update.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (4 by maintainers)

Top Related StackOverflow Question
Great! Closing the issue in that case 😃
I submitted a PR to dotnet/corefx#34465 to fix this which was merged yesterday
I’ve tested my original repro against Winforms and WPF for both .Net Core and .Net Framework and behaviour now appears to be identical.
Unless anyone else wants to verify, I think this issue can be closed.