Share via


WPF Content Model

The Windows Presentation Foundation (WPF) is a presentation platform that provides many control and control-like types whose primary purpose is to display content. The content models of these types can be very flexible, and at times, very rigid. For example, some types can contain only a single piece of content but some can contain multiple items. In addition, the content may be text, other controls, or a specific set of elements.

This topic organizes the control and control-like types based on the inheritance hierarchy and provides a quick reference for the content models of these type families. A content property is a property that is used to store the content of the object. This topic includes only types distributed with the Windows SDK.

For content model information for a specific type family, see the corresponding content model overview.

This topic contains the following sections.

  • ContentControl Classes
  • HeaderedContentControl Classes
  • ItemsControl Classes
  • HeaderedItemsControl Classes
  • Decorator Classes
  • Panel Classes
  • Adorner Classes
  • Flow Text Classes
  • TextBox Class
  • TextBlock Class
  • Shape Classes
  • Related Topics

ContentControl Classes

Description

A ContentControl is a type of Control that contains a single piece of content.

Content properties

Content

Content model information

Controls Content Model Overview

Types that belong to this type family

Button, ButtonBase, CheckBox, ComboBoxItem, ContentControl, Frame, GridViewColumnHeader, GroupItem, Label, ListBoxItem, ListViewItem, NavigationWindow, RadioButton, RepeatButton, ScrollViewer, StatusBarItem, ToggleButton, ToolTip, UserControl, Window

Types that can contain ContentControl types

ContentControl Classes, HeaderedContentControl Classes, ItemsControl Classes, HeaderedItemsControl Classes, Panel Classes, Decorator Classes, Adorner Classes

Subcategories

HeaderedContentControl Classes

HeaderedContentControl Classes

Description

A HeaderedContentControl is a type of ContentControl that contains a single piece of content and also has a Header.

Content properties

Content, Header

Content model information

Controls Content Model Overview

Types that belong to this type family

Expander, GroupBox, HeaderedContentControl, TabItem

Types that can contain HeaderedContentControl types

ContentControl Classes, HeaderedContentControl Classes, ItemsControl Classes, HeaderedItemsControl Classes, Panel Classes, Decorator Classes, Adorner Classes

ItemsControl Classes

Description

An ItemsControl is a type of Control that can contain multiple items, such strings, objects, or other elements.

Content properties

Items, ItemsSource

Primary content type

Multiple items that may be strings, objects, or other elements.

Content model information

Controls Content Model Overview

Types that belong to this type family

Menu, MenuBase, ContextMenu, ComboBox, ItemsControl, ListBox, ListView, TabControl, TreeView, Selector, StatusBar

Types that can contain ItemsControl types

ContentControl Classes, HeaderedContentControl Classes, ItemsControl Classes, HeaderedItemsControl Classes, Panel Classes, Decorator Classes, Adorner Classes

Subcategories

HeaderedItemsControl Classes

HeaderedItemsControl Classes

Description

A HeaderedItemsControl is a type of ItemsControl that can contain multiple items, such strings, object, or other elements, and also has a header.

Content properties

Header, Items, ItemsSource

Content model information

Controls Content Model Overview

Types that belong to this type family

HeaderedItemsControl, MenuItem, TreeViewItem, ToolBar

Types that can contain HeaderedItemsControl types

Typically, MenuItem objects are used as child elements of a Menu element; TreeViewItem objects are used as child elements of a TreeView element; and ToolBar objects are used as child elements of a ToolBarTray.

Decorator Classes

Description

A Decorator is a type of FrameworkElement that applies effects onto or around a single child UIElement.

Content properties

Child

Primary content type

A single UIElement

Content model information

Decorator Content Model Overview

Types that belong to this type family

ButtonChrome, ClassicBorderDecorator, ListBoxChrome, SystemDropShadowChrome, Border, InkPresenter, BulletDecorator, Viewbox, AdornerDecorator

Types that can contain Decorator Types

ContentControl Classes, HeaderedContentControl Classes, ItemsControl Classes, HeaderedItemsControl Classes, Panel Classes, Decorator Classes, Adorner Classes

Panel Classes

Description

A Panel is a type of FrameworkElement that positions and arranges child objects. For more information, see Panels Overview.

Content properties

Children

Primary content type

One or more UIElement objects.

Content model information

Panel Content Model Overview

Types that belong to this type family

Canvas, DockPanel, Grid, TabPanel, ToolBarOverflowPanel, StackPanel, ToolBarPanel, UniformGrid, VirtualizingPanel, VirtualizingStackPanel, WrapPanel

Types that can contain Panel types

ContentControl Classes, HeaderedContentControl Classes, ItemsControl Classes, HeaderedItemsControl Classes, Panel Classes, Decorator Classes, Adorner Classes

Adorner Classes

Description

An Adorner is a FrameworkElement that is bound to ("adorns") a single UIElement. For more information, see Adorners Overview.

Content properties

None.

Primary content type

None.

Content model information

N/A

Types that belong to this type family

The Adorner class is provided as a framework for creating your own adorners; Windows Presentation Foundation (WPF) does not provide any implemented adorners.

Flow Text Classes

Description

A TextElement is a type of FrameworkContentElement that contains text or other TextElement objects. TextElement and its derived classes are used to make up flow content. For more information on flow content, see Flow Document Overview.

Content properties

See TextElement Content Model Overview for more information.

Primary content type

Multiple items that may be strings, objects, or other elements.

Content model information

TextElement Content Model Overview

Types that belong to this type family

AnchoredBlock, Block, BlockUIContainer, Bold, Figure, Floater, Hyperlink, Inline, InlineUIContainer, Italic, LineBreak, List, ListItem, Paragraph, Run, Section, Span, Table, Underline

Types that can contain Flow Text types

FlowDocument Class

TextBox Class

Description

A TextBox is a control that can be used to display or edit unformatted text. A TextBox supports unformatted text only. For applications that require support for richer content, see RichTextBox.

Content properties

Text

Primary content type

Strings

Content model information

TextBox Content Model Overview

Types that belong to this type family

TextBox

Types that can contain TextBox classes

ContentControl Classes, HeaderedContentControl Classes, ItemsControl Classes, HeaderedItemsControl Classes, Panel Classes, Decorator Classes, Adorner Classes, Flow Text Classes

TextBlock Class

Description

A TextBlock is a lightweight control for displaying small amounts of flow content.

Content properties

Inlines

Content model information

TextBlock Content Model Overview

Types that belong to this type family

TextBlock

Types that can contain TextBlock classes

ContentControl Classes, HeaderedContentControl Classes, ItemsControl Classes, HeaderedItemsControl Classes, Panel Classes, Decorator Classes, Adorner Classes, Flow Text Classes

Shape Classes

Description

A Shape is a type of FrameworkElement that displays a geometric shape.

Content properties

None.

Primary Content Type

None.

Content model information

N/A

Types that belong to this type family

See the Shape class for a list of types that derive from Shape.

Types that can contain Shape types

ContentControl Classes, HeaderedContentControl Classes, ItemsControl Classes, HeaderedItemsControl Classes, Panel Classes, Decorator Classes, Adorner Classes

See Also

Other Resources

WPF Fundamentals