Several item templates in one listbox in mvvmcross

2019-08-11 19:46发布

问题:

I use MvvmCross framework. I want to use different item templates in one listview depending on ViewModel type. For example I have the list of AnimalViewModels. And I want KittenViewModel and PuppyViewModel look different.

I found out how to do this in iOS and WP7. How to implement this in Android.

Thank you

回答1:

A few of the samples show how to use cell type selection. See:

  • polymorphic lists in https://github.com/slodge/MvvmCross-Tutorials/tree/master/Working%20With%20Collections

  • grouped lists in the session list views in https://github.com/slodge/MvvmCross-Tutorials/tree/master/Sample%20-%20CirriousConference