public bool CanRemove(object obj) { if (CurrentSotrudniki.Count != 0) { var sotr = from x in CurrentSotrudniki where x.IsSelected == true select x; if ((sotr.ToList()).Count > 0) { foreach (var item in sotr.ToList()) { RemoveSotrudniki.Add(item); } return(true); } return(false); } return(false); }
public void Remove(object obj) { var sotr = from x in CurrentSotrudniki where x.IsSelected == true select x; if ((sotr.ToList()).Count > 0) { foreach (var item in sotr.ToList()) { RemoveSotrudniki.Add(item); } } foreach (var sotrs in RemoveSotrudniki) { var f = sotrs; CurrentSotrudniki.Remove(sotrs); AallSotrudniki.Remove(f); } }