public void SaveXml(Stream s)
        {
            var config = new Configuration();

            // fill config
            config.UserName = UserName.Value;
            SynchronizeLists.Sync(config.Sites, Sites, (a, b) => false, site => new SiteEntry(site.SiteName.Value, site.Counter.Value, site.Login.Value, site.TypeOfPassword.Value));

            // save it
            config.Save(s);
        }
        public void ReadXml(Stream s)
        {
            // load config
            var config = new Configuration();

            config.Load(s);

            // apply it's changes to us
            UserName.Value = config.UserName;

            SynchronizeLists.Sync(Sites, config.Sites, siteXml =>
                {
                    var site = new ConfigurationSiteViewModel();
                    site.Login.Value = siteXml.Login;
                    site.SiteName.Value = siteXml.SiteName;
                    site.Counter.Value = siteXml.Counter;
                    site.TypeOfPassword.Value = siteXml.Type;
                    return site;
                }
                );

            SelectedItem.Value = Sites.FirstOrDefault();

            ResetMasterPassword.SetValue(true);
        }