Binding to groups of different ViewModels? (Combining images and text articles)

I am contacting to figure out how to use a GridView with different classes for groups. In the GridApp template, everything inherits from SampleDataCommon, should you always inherit from the general class in the GridView? The documentation seems .. missing on this mother.

UPDATE: In particular, the problem I'm trying to solve is to have a GridView with images and text news articles.

0
source share
1 answer

You can bind to any type of class. I would suggest that they implement a common interface or class. If they cannot, grouping them simply does not make sense. You can display elements within a group using a DataTemplateSelector. Here is a very simple example and a more complex example.

0
source

Source: https://habr.com/ru/post/1433827/


All Articles