I have a TabControl where each TabItem shows a ListView.
The list is the same for each tab, but it is sorted by different fields depending on the tab selected.
So, I don’t want that each TabItem contains a different ListView:
<TabControl>
<TabItem>
<ListView/>
</TabItem>
<TabItem>
<ListView/>
</TabItem>
</TabControl>
How can I accomplish this?
Quick and Easy. Let the code just the way it is now. Then have just one list on your ViewModel and you can have N diferent readonly properties (where N is the number of tabs) who will return the same list but sorted by your desired order.
The thing is:
But that’s precisely what you’re doing. Having a sorted-different list within each TabItem.
Example
View:
ViewModel: