private void OnDeleteUseRoelButtonClick(object sender, RoutedEventArgs e) { if (UserRolesList.SelectedItem != null && CustomMessageBox.Ask("确定要删除该用户的角色吗?")) { SelectedRoles.Remove(UserRolesList.SelectedItem as UserRoleRel); UserRolesList.ItemsSource = null; UserRolesList.ItemsSource = SelectedRoles; } }
private void ExecuteRemoveRoleViewCommand() { try { SelectedRoles.Remove(SelectedRole); FilteredRoles = new ObservableCollection <RoleDTO>(Roles.Except(SelectedRoles)); } catch { MessageBox.Show("Can't Remove Role"); } }