Files
docs-desktop/dotnet-desktop-guide/framework/wpf/data/how-to-implement-a-compositecollection.md
T
Andy (Steve) De George e9fcf43083 Merge pull request #1135 from dotnet/adegeo-links
Correct .NET Framework links that pointed to old .NET 5 URLs
2021-08-11 12:04:34 -07:00

1.1 KiB

title, ms.date, helpviewer_keywords, ms.assetid
title ms.date helpviewer_keywords ms.assetid
How to: Implement a CompositeCollection 03/30/2017
data binding [WPF], CompositeCollection class
0d8fc84c-7920-427f-8ad7-d55ca656c170

How to: Implement a CompositeCollection

Example

The following example shows how to display multiple collections and items as one list using the xref:System.Windows.Data.CompositeCollection class. In this example, GreekGods is an xref:System.Collections.ObjectModel.ObservableCollection%601 of GreekGod custom objects. Data templates are defined so that GreekGod objects and GreekHero objects appear with a gold and a cyan foreground color respectively.

[!code-xamlCompositeCollections#1]

See also