public void Filter(string query) { var count = Items.Count; var items = !string.IsNullOrWhiteSpace(query) ? OriginalValues.Where(i => i.Name.Contains(query)).ToList() : OriginalValues; Items = items; EmptyText.Visibility = Items.Count > 0 ? ViewStates.Gone : ViewStates.Visible; NotifyItemRangeRemoved(0, count); NotifyItemRangeInserted(0, Items.Count); }
public IEnumerator <KeyValuePair <TKey, TValue> > GetEnumerator() => OriginalValues.Where(item => IsKeyFiltered(item.Key)).GetEnumerator();