tags:

views:

19

answers:

2

What's best practice for a WPF windows application re where to store confirm data that a child window captures?

That is, say from main page you click "configure" to jump to a configuration window/dialog. Where should the config data be stored so that when finished the main screen can access it when the user clicks on a button that initiates an event that needs the config data.

Would putting the data as instance variables in the main window class be the normal way?

+1  A: 

I would expect that you are persisting the configuration data in some way (file, db, etc.)

I would write the configuration window to be interact with the objects that model that data and be independent of the main window.

Also since you probably only need a single instance of configuration data it makes sense to make it a singleton. You could then create an event that is fired when your configuration data changes that your main screen handles.

Conrad Frix
+1  A: 

If you don't want to or can't use database, and want to persist configuration changes then use Application Settings.

Faisal
so use the Application Settings like global variables for the application correct?
Greg