Esempio n. 1
0
        public void filter(FriendsCustomAdapter adapter, string constraint)
        {
            if (constraint != null && constraint.Length > 0)
            {
                ObservableCollection <UserItem> matchList = new ObservableCollection <UserItem>();
                foreach (UserItem item in adapter.persons.ToList())

                {
                    if (item.Name.StartsWith(constraint.ToString()))
                    {
                        matchList.Add(item);
                    }
                }

                adapter.persons = matchList;
                adapter.NotifyDataSetChanged();
            }
        }
Esempio n. 2
0
 public FriendsFilter(FriendsCustomAdapter friendsCustomAdapter)
 {
     this.friendsCustomAdapter = friendsCustomAdapter;
 }