public override void ViewDidLoad() { base.ViewDidLoad(); addUserContacts = new AddUserContacts(); lstContacts = addUserContacts.AddContacts(10); tableSource = new TableSource(lstContacts, this); contactsTableView.Source = tableSource; AddItem.Clicked += (sender, e) => { OpenAddDialog(); }; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_main); addUserContacts = new AddUserContacts(); lstContacts = addUserContacts.AddContacts(10); recycler = FindViewById <RecyclerView>(Resource.Id.recyclerView); layoutManager = new LinearLayoutManager(this); recycler.SetLayoutManager(layoutManager); adapter = new RecycleViewAdapter(lstContacts.getContacts()); recycler.SetAdapter(adapter); var addItem = FindViewById <ImageView>(Resource.Id.addNewContact); addItem.Click += (sender, e) => { openAddDialog(); }; }