예제 #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();
            }
        }
예제 #2
0
 public FriendsFilter(FriendsCustomAdapter friendsCustomAdapter)
 {
     this.friendsCustomAdapter = friendsCustomAdapter;
 }