This documentation is archived and is not being maintained.

ContentElement Class

Provides a WPF core-level base class for content elements. Content elements are designed for flow-style presentation, using an intuitive markup-oriented layout model and a deliberately simple object model.

Namespace:  System.Windows
Assembly:  PresentationCore (in PresentationCore.dll)

public class ContentElement : DependencyObject, 
	IInputElement, IAnimatable
<ContentElement .../>

ContentElement defines the following common content characteristics:

  • Input: All ContentElement derived classes provide support for basic input capture from keyboard, mouse, drag-and-drop operations, stylus controls, and accelerators.

  • Focus: All ContentElement derived classes are potentially focusable. (However, the default focusable state for the ContentElement base class is false. For details on how to make a ContentElement focusable, see Focusable.) In addition, this class contains APIs that you can use for traversing the focus across related elements.

  • Events: ContentElement includes events that are related to input and focus; it also includes events for changes in state. In many cases, the ContentElement events are routed events. In some cases, routed events have both tunneling and bubbling routing strategies, raised as separate events in response to the same state or condition. Also, ContentElement defines APIs that can raise routed events and that can add or remove handlers to events.

ContentElement shares many common APIs with UIElement. These common APIs do not come from a shared class inheritance. But they do share common naming, similar behavior, and similar internal implementation of APIs in each class. The similarity is because ContentElement and UIElement are each classes that are an element base, although each has different intentions for its markup object model behavior.

In particular, UIElement descends from Visual, which provides the lower-level graphics support for rendering a ContentElement to a rectangular region within a composited window, whereas ContentElement defers rendering so that concepts more common to document scenarios, such as flow and wrapping, are more easily supported. These two related classes also implement the common interfaces IInputElement and IAnimatable.

Notes to Inheritors:

The ContentElement class does not yet define all aspects of a complete content element for flow-style presentation. FrameworkContentElement is an immediately derived class of ContentElement. FrameworkContentElement includes a more complete set of additional members that support rendering a FrameworkContentElement within a content host and using the WPF framework-level layout system.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0