示例#1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Main);

            //Toolbar Set-Up
            var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);

            //List Set-Up
            LoadList();
            _listView = FindViewById <ListView>(Resource.Id.List);

            ListAdapter          = new ListAdapter(this, ContactList);
            _listView.Adapter    = ListAdapter;
            _listView.ItemClick += OnListItemClick;
        }
示例#2
0
        private void searchButton_Click(object sender, EventArgs e)
        {
            // Toast.MakeText(this, "delete success!", ToastLength.Short).Show();
            // _contactSelected
            ContactListNew.AddRange(ContactList);
            ContactListNew = ContactListNew.Distinct().ToList();
            EditText name = (EditText)FindViewById(Resource.Id.searchTxt);

            if (!string.IsNullOrEmpty(name.Text))
            {
                ContactList = ContactListNew.FindAll(c => c.Name.Contains(name.Text));
                //ListAdapter.NotifyDataSetChanged();
                // _dialog.Dismiss();
                ListAdapter       = new ListAdapter(this, ContactList);
                _listView.Adapter = ListAdapter;
                // _listView.ItemClick += OnListItemClick;
                //Button searchButton = (Button)FindViewById(Resource.Id.buttonsearch);
                //searchButton.Click += searchButton_Click;
            }
        }