private void btnAssignSelectedSecurityGroups_Click(object sender, RoutedEventArgs e) {//set the selected items for the _viewModel _viewModel.SelectedAvailableSecurityGroupList = lbxAvailableSecurityGroups.SelectedItems; //do the required MenuSecurity CRUD _viewModel.AssignSelectedSecurityGroupsCommand(); //need to remove from list and add to the other list... for (int j = lbxAvailableSecurityGroups.SelectedItems.Count - 1; j >= 0; j--) {//move item from one list to the other... SecurityGroup item = (SecurityGroup)lbxAvailableSecurityGroups.SelectedItems[j]; _viewModel.AvailableSecurityGroupList.Remove((SecurityGroup)item); _viewModel.AssignedSecurityGroupList.Add((SecurityGroup)item); } lbxAvailableSecurityGroups.SelectedItems.Clear(); }