Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. Save/Load view configuration to/from xml file

Save/Load view configuration to/from xml file

Scheduled Pinned Locked Moved WPF
questionwpfxmlworkspace
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    columbos14927
    wrote on last edited by
    #1

    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

    M A 2 Replies Last reply
    0
    • C columbos14927

      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

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      Although this article [^]is for winforms it may give you some ideas. I would also check out the comment from Tom Clement and see if he did an article on FormEx.

      Never underestimate the power of human stupidity RAH

      1 Reply Last reply
      0
      • C columbos14927

        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

        A Offline
        A Offline
        Abhinav S
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups