Ticket Q488085
Visible to All Users

Application settings and singleton

created 12 years ago

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.

Answers approved by DevExpress Support

created 12 years ago (modified 12 years ago)

Hello Andreas,
There are several good ways to store settings in XAF:

  1. Use a persistent singleton class
  2. 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.
  3. 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)).
  4. Use any other solution you would use for the same task in a regular non-XAF application.
    Show previous comments (1)
    Dennis Garavsky (DevExpress) 12 years ago

      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).

      AT AT
      Andreas Tsouchlaris 12 years ago

        Thank you again Dennis! That was what I needed.

        Dennis Garavsky (DevExpress) 12 years ago

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.