Using collection view with mixed types elements ? (heterogeneous collection) #27235
Unanswered
bebenlebricolo
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi guys !
Lately I've been trying to achieve something that looks like this using heterogeneous data collections :
This is using different data models (one for the date separator, the other one the actual card content).
The interesting part, I believe, lies around the Date separators which can be used to construct a mixed UI.
I saw that something of this sort might be achievable via DataTemplateSelector, and I would like to do it with a mix of code behind and Xaml (I find data template selector cumbersome, where we could rely on Custom ContentViews to provide a rendering entry point.)
Assuming that we have :
Would it be possible to have on the main page :
and in the Page's ViewModel :
The idea would be that in absence of custom DataTemplate (which is very convenient for development), we'd rely on the ContentViews list only to derive the look of the CollectionView ?
I also tried ListView control, but it seems it works more or less the same way, regarding how data is displayed.
Beta Was this translation helpful? Give feedback.
All reactions