【发布时间】:2016-05-19 10:58:42
【问题描述】:
我正在使用 MVVMCross 开发一个应用程序,它使用故事板作为 UI。在情节提要中,我有一个 UITableView,其中包含静态单元格。如何将 ICommand(或 IMvxCommand)绑定到单击或触摸静态单元格?
目前我正在使用 UITapGestureRecognizer,但我认为这不是最合适的方式。
tableViewController.StaticCell.AddGestureRecognizer(new UITapGestureRecognizer(() =>
{
if (ViewModel.SomeCommand.CanExecute())
{
ViewModel.SomeCommand.Execute(null);
}
}));
【问题讨论】:
标签: xamarin xamarin.ios mvvmcross