maui-bindableproperty-generator icon indicating copy to clipboard operation
maui-bindableproperty-generator copied to clipboard

Make propertyChanged and propertyChanging null by default

Open tranb3r opened this issue 1 year ago • 1 comments

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?

tranb3r avatar Dec 14 '23 11:12 tranb3r

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

rrmanzano avatar Dec 20 '23 19:12 rrmanzano