-
Notifications
You must be signed in to change notification settings - Fork 299
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
ObservablePropertyAttribute on a field: avoid CS0169? #375
Comments
(Hm, maybe https://github.com/CommunityToolkit/dotnet is the more appropriate repo? Not sure.) |
Mmh is your code actually compiling? That field name is incorrect, as it starts with an uppercase character 🤔 |
I tried with the variants So I don't think that's the issue. However, my use of the .NET 5 SDK (due to some regressions in 6.0) could be it? {
"sdk": {
"version": "5.0.400"
}
} |
@chucker which version of the MVVM package are you using? If it's 8.0, I'm pretty sure you have to be building with .NET 6. |
It is indeed 8.0. Other than the compiler warning, it seems to work fine (at least for If someone can confirm that this is indeed a known issue in the .NET 5 SDK, then fair enough. |
Couldn't repro this, but I've added one more unit test to cover this too in a PR. Thank you! 🙂 |
I made a simple INPC property like so:
As expected, I can now bind to
IsReadOnly
in XAML. Great! However, VS now shows me a warning:Makes sense; it doesn't understand that the field exists only for the generated code. However:
#warning pragma disable CS0169
, the warning doesn't go away. Am I missing something?The text was updated successfully, but these errors were encountered: