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

Default value raw #21

Closed fnajera-rac-de closed 9 months ago

fnajera-rac-de commented 1 year ago

Add property DefaultValueRaw

The "magic" behavior of DefaultValue for string types is very helpful for most scenarios, but it makes one scenario particularly difficult: if you want to use a string field/const as default value for a string autobindable property. See test case "Create_With_DefaultValue_As_String_Code"

This change adds an extra property DefaultValueRaw which is always written as-is in the generated code, no matter of what type the property has.

rrmanzano commented 9 months ago

Hi @fnajera-rac-de that is great !! thanks for your contribution. In the next version, I will add some documentation related to this