rrmanzano / maui-bindableproperty-generator

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

Make propertyChanged and propertyChanging null by default #23

Open tranb3r opened 10 months ago

tranb3r commented 10 months ago

Would it be possible to make propertyChanged / propertyChanging default value null, and generate the code only when OnXXXChanged / OnXXXChanging method is implemented?

It's purely an optimization, to avoid generating code and calling methods for nothing.

What do you think?

rrmanzano commented 10 months ago

Hi @tranb3r thanks for your feedback, I will take a look if that is possible, the only implication that I see at this moment is that the library is generating by default a partial method if you don't specify the OnChanged/OnChanging property, and could be the case that the current code is using that partial method. See the example:

Link

I am going to review this case and if possible I will discuss what is the best way to do it if it does not affect the current behavior. Thanks