rrmanzano / maui-bindableproperty-generator

Source generator that automatically transforms fields into BindableProperties that can be used in MAUI
MIT License
132 stars 10 forks source link

Supress Warnings For AutoBindable Field #19

Open Axemasta opened 1 year ago

Axemasta commented 1 year ago

Currently if your control has an autogenerated bindable property, you will get IDE warnings for an unused field:

[AutoBindable]
private readonly ICommand? completedCommand;

I have noted the following warnings:

My proposal is to generate suppression attributes for these warnings since we know they aren't actually unused. I believe the MVVM community toolkit does a similar thing so maybe there is code to copy across.

MVVM toolkit also has a warning for accessing a backing field directly, perhaps that might be useful for this library?

I am happy to take on the work for this feature!

tranb3r commented 9 months ago

I'd really like this to be fixed. Indeed it's very similar to CommunityToolkit.Mvvm.

rrmanzano commented 9 months ago

Hi, @Axemasta yes, I am working on this fix, and should be ready soon, I will keep you updated on this thread. Thanks for your feedback !!