Hello,
I am trying to decide how to store user settings in XAF.
What I used to do was having a table with name value pairs which would store the various settings.
From what i can gather the recommended solution is to use a singleton having a column for every option. Is this correct?
Is there an easy way for me to implement the value pair solution?
Thank you.
Application settings and singleton
Answers approved by DevExpress Support
Hello Andreas,
There are several good ways to store settings in XAF:
- Use a persistent singleton class
- Use the Application Model
For instance, you can implement a custom model extension that will hold the value and then create another element that will have a list of the first elements. Of course, the application model can be physically stored in the database, if required. - Use the ValueManager class (How to save an application's settings at runtime and then access them via a common interface from both Windows Forms and ASP.NET platform-dependent modules (Example)).
- Use any other solution you would use for the same task in a regular non-XAF application.
Do you ever need this popup window functionality? If so, then you can create a WindowController with your Action or rather a ViewController whose TargetViewType is set to DashboardView.
For the dashboard, it would be sufficient to embed a Singleton_DetailView into the dashboard. To specify the object to be shown in this detail form, set the DetailView.CurrentObject property from a ViewController (within the overridden OnViewControlsCreated method).
You are always welcome, Andreas!
News, tips & tricks and other interesting information about DevExpress Application Framework and ORM