eshy / MvvmCross-Controls

Controls for MvvmCross Android
2 stars 0 forks source link

Binding for Click and LongClick on section header crash app #2

Open ornolisvt opened 7 years ago

ornolisvt commented 7 years ago

I´m using the control SectionedRecyclerView to group some data on mvxrecycler. I have a binding for click and longclick on the items. But when make click on a section header the app crash because can´t cast the object to desired model. I wait a model type but in the section header it´s only string.

Please help

HIMISOCOOL commented 5 years ago

its a bit late now but make your click commands of type object and then check for the type in the action for the command.

private void OnSelectItem(object item)
{
      if (item is ItemViewModel) ...
}