Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When changing value from inherited to the default one, control doesn't raise any property changed events #10345

Closed
maxkatz6 opened this issue Feb 15, 2023 · 0 comments · Fixed by #10348

Comments

@maxkatz6
Copy link
Member

Describe the bug

When changing value from inherited to the default one, control doesn't raise any property changed events.

To Reproduce
Steps to reproduce the behavior:

In ValueStoreTests_Inheritance.cs

[Fact]
public void Child_Notifies_About_Setting_Back_To_Default_Value()
{
    var parent = new Class1();
    var child = new Class1();

    parent.Foo = "changed";
    child.Parent = parent;

    bool raised = false;
    child.PropertyChanged += (_, args) =>
    {
        raised = args.Property == Class1.FooProperty && args.GetNewValue<string>() == "foodefault";
    };
    
    Assert.Equal("changed", child.Foo); // inherited from parent.

    child.Foo = "foodefault"; // reset back to default.
    Assert.True(raised); // expect event to be raised, as actual value was changed.
}

Expected behavior

Control notifies about changing its value from inherited to the default.

Desktop (please complete the following information):

  • OS: any
  • Version 11.0.0-preview5, master

Additional context

Reported here #10201 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant