Export (0) Print
Expand All

Visual Class

Updated: July 2008

Provides rendering support in WPF, which includes hit testing, coordinate transformation, and bounding box calculations.

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

'Declaration
Public MustInherit Class Visual _
	Inherits DependencyObject
'Usage
Dim instance As Visual
This class is abstract; see Inheritance Hierarchy for derived non-abstract classes usable in XAML.

The Visual class is the basic abstraction from which every FrameworkElement object derives. It also serves as the entry point for writing new controls in WPF, and in many ways can be thought of as an equivalent of a window handle (HWND) in the Win32 application model.

The Visual object is a core WPF object, whose primary role is to provide rendering support. User interface controls, such as Button and TextBox, derive from the Visual class, and use the Visual defined properties for persisting their rendering data. The Visual object provides support for the following:

  • Output display: Rendering the persisted, serialized drawing content of a visual.

  • Transformations: Performing transformations on a visual.

  • Clipping: Providing clipping region support for a visual.

  • Hit testing: Determining whether a specified coordinate (point) or geometry is contained within the bounds of a visual.

  • Bounding box calculations: Determining the bounding rectangle of a visual.

Architecturally, the Visual object does not include support for other application development requirements / WPF features that are not immediately related to its rendering, such as the following:

  • Event handling

  • Layout

  • Styles

  • Data binding

  • Globalization

Visual is provided as a public abstract class from which further classes can be derived. The following illustration shows the hierarchy of the existing visual objects that are defined in the WPF architecture.

Visual class hierarchy

Diagram of classes derived from the Visual object

In some cases, members that are defined as protected in Visual are exposed as more readily accessible members with similar names in the derived UIElement class.

For more information, see Windows Presentation Foundation Graphics Rendering Overview.

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

Date

History

Reason

July 2008

Added new member: VisualEffect property.

SP1 feature change.

Community Additions

ADD
Show:
© 2014 Microsoft