0
所以我有一些ListView填充數據。我有物品點擊處理程序。它看起來是那麼從ListViewItem中的事件參數獲取數據點擊處理程序
var listview = FindViewById<ListView>(Resource.Id.myList);
listview .ItemClick += OnItemClick;
// populating listview items
MyModel[] someDataArray = GetData();
listview .Adapter = new MyAdapter(this, someDataArray);
....
protected async void OnItemClick(object sender, AdapterView.ItemClickEventArgs e)
{
// here i would like to perfom some actions with instance of MyModel
// associated with current ListView's Item
}
我想獲得與OnItemClick事件處理ListView的項目相關聯爲MyModel的情況下,但我不知道我能得到這個事件處理這種模式。