Open JaiganeshKumaran opened 2 years ago
Hello, 'Jaiganeshkumaran! Thanks for submitting a new feature request. I've automatically added a vote 👍 reaction to help get things started. Other community members can vote to help us prioritize this feature in the future!
@Sergio0694
I'm not convinced that we need to introduce a new source generator for this. The user is able to use the existing source generators, create a view model with their settings, then hook into the PropertyChanged
event to save the new value using whatever settings store they prefer.
Describe the problem this feature would solve
Today app developers have to write a lot of boilerplate code for app settings. Consider providing a source generator and an dd an AppSettingProperty attribute to simplify settings access as an observable property.
Describe the solution
Provide a new interface named ISettingsProvider which could be implemented by the class managing the settings. This way the app can use their own method to store and retrieve settings.
Then the developer could create an interface that inherits from ISettingsProvider and exposes the settings as properties with an attribute.
Implementation of the view model:
The source generator would automatically generate the code for the MyAppSetting property with the help of the GetSetting and SetSetting methods. Generated code:
Describe alternatives you've considered
None.