public UploadDialogViewModel(List <AppInfo> list, UserConfiguration uc) { this.ValidApps = new List <AppDialogViewModel>(); foreach (AppInfo app in list) { AppDialogViewModel newVM = new AppDialogViewModel(app); newVM.PropertyChanged += (sender, p) => { if (p.PropertyName.Equals("CanUpload")) { this.NotifyOfPropertyChange(() => this.CanUpload); } }; this.ValidApps.Add(newVM); } if (this.ValidApps.Count == 1) { this.SelectedApp = this.ValidApps[0]; } else { this.SelectedApp = null; } this._activeUserConfiguration = uc; }
public UploadDialogViewModel(List<AppInfo> list, UserConfiguration uc) { this.ValidApps = new List<AppDialogViewModel>(); foreach (AppInfo app in list) { AppDialogViewModel newVM = new AppDialogViewModel(app); newVM.PropertyChanged += (sender, p) => { if (p.PropertyName.Equals("CanUpload")) { this.NotifyOfPropertyChange(() => this.CanUpload); } }; this.ValidApps.Add(newVM); } if (this.ValidApps.Count == 1) { this.SelectedApp = this.ValidApps[0]; } else { this.SelectedApp = null; } this._activeUserConfiguration = uc; }