Storing entity in XML, using MVVM to read/write in WPF Application

Posted by Christian on Stack Overflow See other posts from Stack Overflow or by Christian
Published on 2010-04-03T12:41:17Z Indexed on 2010/04/03 12:43 UTC
Read the original article Hit count: 416

Filed under:
|
|
|

Say I've a class (model) called Instance with Properties DatbaseHostname, AccessManagerHostname, DatabaseUsername and DatabasePassword

    public class Instance
{
    private string _DatabaseHostname;

    public string DatabaseHostname
    {
        get { return _DatabaseHostname; }
        set { _DatabaseHostname = value; }
    }
    private string _AccessManagerHostname;

    public string AccessManagerHostname
    {
        get { return _AccessManagerHostname; }
        set { _AccessManagerHostname = value; }
    }
    private string _DatabaseUsername;

    public string DatabaseUsername
    {
        get { return _DatabaseUsername; }
        set { _DatabaseUsername = value; }
    }

    private string _DatabasePassword;

    public string DatabasePassword
    {
        get { return _DatabasePassword; }
        set { _DatabasePassword = value; }
    }
}

I'm looking for a sample code to read/write this Model to XML (preferably linq2XML) => storing 1:n instances in XML. i can manage the the view and ViewModel part myself, although it would be nice if someone had a sample of that part too..

© Stack Overflow or respective owner

Related posts about linqtoxml

Related posts about wpf