MVVMCross iOS: как вызвать RowSelected на пользовательском TableViewSource с помощью CreateBindingSet?

У меня вопрос к MVVMCross в iOS. У меня есть собственный TableView и detailView. Как я могу связать свой «showDetailCommand», чтобы при щелчке пользователя по одной из строк в TableView с помощью триггера RowSelected для переключения на detailViewModel?

Вот моя структура кода:

public class SearchResultsViewModel: MvxViewModel
{
    private MvxCommand _showDetailCommand;
    public IMvxCommand ShowDetailCommand
    {
        get
        {
            _showDetailCommand = _showDetailCommand ?? new MvxCommand(ShowDetailCommandHandler);
            return _showMapCommand;
        }
    }

    private void ShowDetailCommandHandler()
    {
        ShowViewModel<ResultDetailViewModel>(new
            {
                city = _filter.City,
                state = _filter.State,
                interstate = _filter.Interstate,
                travelPlaza = _filter.SearchTravelPlaza,
                hasCatScale = _filter.HasCatScale,
                hasWashoutExpress = _filter.HasWashoutExpress,
                hasUndercarriage = _filter.HasUndercarriage,
                nearest = _nearest
            });
    }
}

[Register("SearchResults")]
public class SearchResultsView : MvxTableViewController
{
    public override void ViewDidLoad()
    {
                Title = "List";
                base.ViewDidLoad();
                var source = new TableViewSource(TableView);

                var bindings = this.CreateBindingSet<SearchResultsView, SearchResultsViewModel>();
                bindings.Bind(source).To(vm => vm.Items);
                bindings.Apply();

                TableView.BackgroundColor = UIColor.Clear;
                TableView.ShowsVerticalScrollIndicator = false;
                TableView.ScrollEnabled = true;
                TableView.SeparatorStyle = UITableViewCellSeparatorStyle.None;
                TableView.Source = source;

                TableView.ReloadData();

    }

    public class TableViewSource : MvxTableViewSource
    {
        public TableViewSource(UITableView tableView)
            : base(tableView)
        {
            tableView.RegisterClassForCellReuse(typeof(TableViewCell), TableViewCell.CellIdentifier);
        }

        public override float GetHeightForRow(UITableView tableView, NSIndexPath indexPath)
        {
            var item = GetItemAt(indexPath);
            return TableViewCell.CellHeight(item);
        }

        protected override UITableViewCell GetOrCreateCellFor(UITableView tableView, NSIndexPath indexPath, object item)
        {
            var cell = tableView.DequeueReusableCell(TableViewCell.CellIdentifier) ?? new TableViewCell();
            return cell;
        }
    }

}

[Register("TableViewCell")]
public class TableViewCell : MvxTableViewCell
{

    public static readonly NSString CellIdentifier = new NSString("TableViewCell");

     public TableViewCell()
        : base()
    {
        Initialise();
    }

    public TableViewCell(IntPtr handle)
        : base(handle)
    {
        Initialise();
    }

    private void Initialise()
    {

        var titleLabel = new UILabel(new RectangleF(10, 2, 200, 25));
        Add(titleLabel);

        this.DelayBind(() =>
        {
            var bindings = this.CreateBindingSet<TableViewCell, SearchResultsItemViewModel>();
            bindings.Bind(titleLabel).For(x => x.Text).To(vm => vm.Name);
            bindings.Bind(??).For(x => x.SelectionChangeCommand).To(vm => vm.showDetailCommand); // what should be in this line ??
            bindings.Apply();
        });

    }

}

Ответы на вопрос(1)

Ваш ответ на вопрос