Etiam placerat

Overview Base Elements

A high percentage of classes in Windows Presentation Foundation (WPF) are derived from four classes which are commonly referred to in the SDK documentation as the base element classes. These are UIElement, FrameworkElement, ContentElement, and FrameworkContentElement.


UIElement

UIElement is a base class for WPF core level implementations building on Windows Presentation Foundation (WPF) elements and basic presentation characteristics.


FrameworkElement

Provides a WPF framework-level set of properties, events, and methods for Windows Presentation Foundation (WPF) elements. This class represents the provided WPF framework-level implementation built on the WPF core-level APIs defined by UIElement.


ContentElement

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.


FrameworkContent

ElementFrameworkContentElement is the WPF framework-level implementation of the ContentElement base class. FrameworkContentElement adds support for additional input APIs (including tooltips and context menus), storyboards, data context for databinding, styles support, and logical tree helper APIs.


Base Element APIs in WPF Classes


Both UIElement and ContentElement are derived from DependencyObject, through somewhat different pathways. The split at this level deals with how a UIElement or ContentElement are used in a user interface and what purpose they serve in an application. UIElement also has isual in its class hierarchy, which is a class that exposes the lower-level graphics support underlying the Windows Presentation Foundation (WPF).

Visual provides a rendering framework by efining independent rectangular screen regions. In practice, UIElement is for elements that will support a larger object model, are intended to render and layout into regions that can be described as rectangular screen regions, and where the content model is deliberately more open, to allow ifferent combinations of elements. ContentElement does not derive from Visual; its model is that a ContentElement would be consumed by something else, such as a reader or viewer that would then interpret the elements and produce the complete Visual for Windows Presentation oundation (WPF) to consume. Certain UIElement classes are intended to be content hosts: they provide the hosting and rendering for one or more ContentElement classes (DocumentViewer is an example of such a class). ContentElement is used as base class for elements with somewhat smaller object models and that more address the text, information, or document content that might be hosted within a UIElement.

0 comments: