mirror of
https://github.com/Stone-Red-Code/docs-desktop.git
synced 2026-09-06 16:06:07 +02:00
Initial WPF content migrated (#17)
* Reset branch for WPF changes * Convert BMP to PNG; fix link-out-of-scope err * Add snippets for WPF... 6794 files!!!! * Add missing snippets * update file updated between migration * Fix paths to include * update breadcrumb and toc * fix index links * fix index links * fix index links * fix markdown
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
---
|
||||
title: "How to: Implement a CompositeCollection"
|
||||
ms.date: "03/30/2017"
|
||||
helpviewer_keywords:
|
||||
- "data binding [WPF], CompositeCollection class"
|
||||
ms.assetid: 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-xaml[CompositeCollections#1](~/samples/snippets/csharp/VS_Snippets_Wpf/CompositeCollections/CS/Window1.xaml#1)]
|
||||
|
||||
## See also
|
||||
|
||||
- <xref:System.Windows.Data.CollectionContainer>
|
||||
- <xref:System.Windows.Controls.ItemsControl.ItemsSource%2A>
|
||||
- <xref:System.Windows.Data.XmlDataProvider>
|
||||
- <xref:System.Windows.DataTemplate>
|
||||
- [Data Binding Overview](/dotnet/desktop-wpf/data/data-binding-overview)
|
||||
- [How-to Topics](data-binding-how-to-topics.md)
|
||||
Reference in New Issue
Block a user