-
Notifications
You must be signed in to change notification settings - Fork 4
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
INPC001 should not trigger for properties decorated with [Bindable(false)] #172
Comments
Derp, forgot that one, thanks for reporting. |
When fixing this, could you also respect [Bindable(false)] on the class lvl? That way i can remove all the attributes on the properties. It would also be more clear |
It seems like you're treating |
It still makes sense for the analyzer to pick up on this attribute. |
I wanna make it obvious how the class is supposed to be used and in my opinion the BindableAttribute does just that. I view disabling warnings as a last resort effort to get a desired result. |
Part of my hesitation is that Browsable is an explicitly design-time-only attribute. This seems to back up my intuition that
https://docs.microsoft.com/en-us/dotnet/api/system.componentmodel.bindableattribute#remarks I would expect non-browsable mutable properties to raise PropertyChanged in some cases just as likely as not. |
The analyzer is a design time only functionality aswell. So anything designtime only is as valid as anything else. A little bit above that warning it says:
this part in particular captures my opinion quite well:
Yea, our expectations diverge here. |
Sounds like my expectation is almost word-for-word the docs quote there 😁 which means, analyzer shouldn't warn because either way is valid. I don't think the designer or the docs address the awkward fact that it has AttributeTargets.All, but it seems a little out there to apply it to the class as a suppression unless there are other existing tools that follow the same logic. The analyzer should match somewhat to the real world. |
The analyzer should respect BindableAttribute
The text was updated successfully, but these errors were encountered: