Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

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)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

public class ContentElement : DependencyObject, IInputElement, IAnimatable
public class ContentElement extends DependencyObject implements IInputElement, IAnimatable
public class ContentElement extends DependencyObject implements 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 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

© 2015 Microsoft