Hello
I'm wondering if any have good input on the best practice to use to
allow a (user)control to remember it's state.
For example, I have a UserControl that I use a lot of places in our
application. I want that contorl to remember it's UI state whenever the
user accesses that same control the next time he startes the
application. For example in a search control, I want to remember the if
the user selected to search by text or by number and automatically
pre-select that the next time the user enters the control.
The search control may occure many times in my application, and the
user may have different preferences for each of the occurrences.
I also want the UserControl to handle it as it would be a lot of
additional, and dublicated code, if I was to add it to the form that
contains the control.
The settings should be saved within the users profile.
We have a lot of simular stuff that the application ideally should
remember.
Any good ideas?
NB: I'm looking for design practices, not how to do actually code it.
If there is any good books on the topic of writing usercontrols I would
appricate input on that as well.
Regards TEK
gourmete - 11 Dec 2006 21:57 GMT
Hi!
Unfortunately I don?t know either. I work with the DevExpress
components. Most of them provide the very usefull method
SaveLayoutToXML and RestoreLayoutFromXML. You could download the trial
version of the component suite and install it with source files.
Perhaps you?ll find some inspiration in this sources while waiting for
more qualified answers :)