public User(string username, string password)
 {
     LocalId = Guid.NewGuid();
     Username = username;
     Password = password;
     Settings = new Settings();
     Libraries = new ObservableCollectionEx<Library>();
     Downloads = new ObservableCollectionEx<QueuedDownload>();
     Save(true);
     SubscribeForComponentChanges();
 }
        public User(XElement xElement)
        {
            LocalId = new Guid(xElement.Attribute(Tags.LocalId).Value);
            Username = xElement.Attribute(Tags.Username).Value;
            Password = xElement.Attribute(Tags.Password).Value;

            XDocument doc = Open();
            XElement root = doc.Element(Tags.User);
            Settings = new Settings(root.Element(Tags.Settings));
            Libraries = new ObservableCollectionEx<Library>(from lib in root.Element(Tags.Libraries).Elements(Tags.Library) select new Library(lib));
            Downloads = new ObservableCollectionEx<QueuedDownload>(from download in root.Element(Tags.Downloads).Elements(Tags.Download) select new QueuedDownload(download));
            SubscribeForComponentChanges();
        }