Пример #1
0
        public MainWindowViewModel()
        {
            _profileManager.ChangedProfilesEvent += UpdateDisplaySettings;
            _appUpdater.UserRequestsInstallEvent += NumberOfRunningCopies;
            _settingsViewModel.PropertyChanged   += SettingsHaveChanged;

            _profileManagerViewModel = new ProfileManagerViewModel(_profileManager);

            foreach (Profile p in _profileManager.Profiles)
            {
                FolderManagerViewModel var = new FolderManagerViewModel(p);
                FolderManagerViewModels.Add(var);
                CollectionContainer cc = new CollectionContainer();
                cc.Collection = var.Assigned;
                this.Assigned.Add(cc);
            }
        }
Пример #2
0
 private void UpdateDisplaySettings()
 {
     foreach (FolderManagerViewModel f in FolderManagerViewModels.Reverse())
     {
         if (!_profileManager.Profiles.Any(item => item.Equals(f.Profile)))
         {
             FolderManagerViewModels.Remove(f);
         }
     }
     foreach (Profile p in _profileManager.Profiles)
     {
         if (!FolderManagerViewModels.Any(item => item.Profile.Equals(p)))
         {
             FolderManagerViewModel var = new FolderManagerViewModel(p);
             var.FolderManager.RefreshFolders();
             FolderManagerViewModels.Add(var);
             CollectionContainer cc = new CollectionContainer();
             cc.Collection = var.Assigned;
             this.Assigned.Add(cc);
         }
     }
 }