private void KeyStakeholdersPickerButtonHandler(object obj) { var rolesAlreadyInUse = new List<Role>(); foreach (var sh in mIssue.IssueRelatedKeyStakeholders) { rolesAlreadyInUse.Add((from x in CMS.Cache.Roles where x.Id == sh.RoleId select x).FirstOrDefault()); } var picker = new RolePicker(rolesAlreadyInUse, true); picker.Show(); picker.Closed += (s1, e1) => { mIssue.IssueRelatedKeyStakeholders.Clear(); foreach (var role in picker.Roles) { mIssue.IssueRelatedKeyStakeholders.Add(new IssueRelatedKeyStakeholder { IssueId = mIssue.Id, RoleId = role.Id }); } RaisePropertyChanged("KeyStakeholders"); }; }
private void RolesPickerHandler(object parameter) { var roles = ReportLinkInstance.ReportLinkRoles.Select(x => x.Role).ToList(); RolePicker rolePicker = new RolePicker(roles); rolePicker.Closed += (sender, args) => { ReportLinkInstance.ReportLinkRoles.Clear(); foreach (var role in rolePicker.Roles) { ReportLinkInstance.ReportLinkRoles.Add(new ReportLinkRole { ReportLinkId = ReportLinkInstance.Id, RoleId = role.Id, Role = role}); } RaisePropertyChanged("Roles"); }; rolePicker.Show(); }