Search code examples
c#wpfmvvmapplication-settings

Create/Save User Settings Dynamically


In order to save user settings in my app I am use the Settings.settings class. This is working fine for things like Username, Email, etc. The problem is that my app is a kind of multi app application and I need to dynamically create settings depending on which "app" the user is using at the time e.g. App1_BackgroundColor, App2_BackgroundColor, etc. I can't statically set these in the Settings.settings class because the user can add and remove "apps" to the application.

How can I create/save user settings on the fly that will persist after the application has been closed?


Solution

  • I ended up just creating my own settings xml file with nodes for each "app". I then just read/write to/from that file.