I'm new with MVVMCross model for iOS. I want to handle tableview cell tap, and get the tapped cell index. But I don't know how to access the index.
Here is my View code.
var menuSource = new MenuTableViewSource(menuTableView, MenuCell.Key, MenuCell.Key);
this.menuTableView.Source = menuSource;
var set = this.CreateBindingSet<BooksView, BooksViewModel>();
set.Bind(menuSource).To(vm => vm.MenuCellTexts);
set.Bind(menuSource).For(s => s.SelectionChangedCommand).To(vm => vm.ItemSelectedCommand);
set.Apply();
Here is my ViewModel code.
private MvxCommand _itemSelectedCommand;
public MvxCommand ItemSelectedCommand
{
get
{
_itemSelectedCommand = _itemSelectedCommand ?? new MvxCommand(DoSelectedItem);
return _itemSelectedCommand;
}
}
private void DoSelectedItem()
{
// How to get the tapped cell index here??
}