Save/Load view configuration to/from xml file
-
Hello, I have the next view XAML file:
The ItemsControl binded to:
public ObservableCollection<UserControl> MemControls
{
get { return _memControls; }
set { _memControls = value; }
}in the view Model. I want to give the user an option to save GUI configuration. So when he press "Save" button i want to serialize the:
public ObservableCollection<UserControl> MemControls
to XML file and when he want to restore GUI configuration i want to to desirialize from an XML file the list of controls and that way to restore GUI configuration.
How can i do it?
Maybe there is some other better way that dont involve XML files?Thanks
-
Hello, I have the next view XAML file:
The ItemsControl binded to:
public ObservableCollection<UserControl> MemControls
{
get { return _memControls; }
set { _memControls = value; }
}in the view Model. I want to give the user an option to save GUI configuration. So when he press "Save" button i want to serialize the:
public ObservableCollection<UserControl> MemControls
to XML file and when he want to restore GUI configuration i want to to desirialize from an XML file the list of controls and that way to restore GUI configuration.
How can i do it?
Maybe there is some other better way that dont involve XML files?Thanks
-
Hello, I have the next view XAML file:
The ItemsControl binded to:
public ObservableCollection<UserControl> MemControls
{
get { return _memControls; }
set { _memControls = value; }
}in the view Model. I want to give the user an option to save GUI configuration. So when he press "Save" button i want to serialize the:
public ObservableCollection<UserControl> MemControls
to XML file and when he want to restore GUI configuration i want to to desirialize from an XML file the list of controls and that way to restore GUI configuration.
How can i do it?
Maybe there is some other better way that dont involve XML files?Thanks
You can always consider using the Infragistics persistance framework to save and retrieve control state - http://www.infragistics.com/products/silverlight/persistence-framework/[^]. Or its not too difficult building your own framework - just serialize and store control attributes directly in the database.
Apps - Color Analyzer | Arctic | XKCD | Sound Meter | Speed Dial