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

Visual Studio 2022 v17.12 breaks binding to [ObservableProperty] #76470

Open
bjorn-malmo opened this issue Dec 17, 2024 · 4 comments
Open

Visual Studio 2022 v17.12 breaks binding to [ObservableProperty] #76470

bjorn-malmo opened this issue Dec 17, 2024 · 4 comments
Labels
Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead

Comments

@bjorn-malmo
Copy link

Version Used:

Building the application using Visual Studio 2022 v17.12.x breaks Binding to [ObservableProperty]
Building the application using Visual Studio 2022 v17.10.6 works perfectly

Please see original issue:
CommunityToolkit/dotnet#1011

Steps to Reproduce:

  1. Project PropertyBindingTest.sln in repo https://github.com/bjorn-malmo/bug-free-happiness/.
  2. Build and run on Visual Studio 2022 v17.12.x
  3. Note that the Binding to ObservableProperty on object deriving from Control is not updated
  4. However, running the same application in Visual Studio 2022 v17.10.6 works

A minimal repro, with source-code provided, is ideal. Most compiler/language issues can be distilled into a snippet that can be pasted into sharplab.

Diagnostic Id:

If this is a report about a bug in an analyzer, please include the diagnostic ID and message if possible (e.g. "IDE0030: Use coalesce expression").

Expected Behavior:
Binding updating value in UI

Actual Behavior:
Binding not updating UI value for property

@CyrusNajmabadi
Copy link
Member

What do you mean by "breaks binding"?

@bjorn-malmo
Copy link
Author

The binding will not update as a result of a PropertyChanged event notification. The issue has been reproduced by CommunityToolkit (see linked issue above), but closed as it is not deemed a problem in CommunityToolkit, but probably something with code generation, as the UI will update if the program is run in older Visual Studio 2022, but not in the latest version.

@CyrusNajmabadi
Copy link
Member

Again, I don't know what "breaks binding" means.

@CyrusNajmabadi
Copy link
Member

The binding will not update as a result of a PropertyChanged event notification

I don't know what this means. What event notification are you referring to? What is a "binding" here?

but probably something with code generation,

What code generation?

if the program is run in older Visual Studio 2022, but not in the latest version.

What code was generated in older versions of visual studio, and what code is now generated in the latest version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

No branches or pull requests

2 participants