Visual Class

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

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

public abstract class Visual : DependencyObject
public abstract class Visual extends DependencyObject
public abstract class Visual extends DependencyObject
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 the 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 it for persisting their rendering data. The Visual object provides support for:

  • 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 coordinate or geometry is contained within the bounds of a visual.

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

However, the Visual object does not include support for non-rendering features, such as:

  • Event handling

  • Layout

  • Styles

  • Data binding

  • Globalization

Visual is exposed as a public abstract class from which child classes must be derived. The following illustration shows the hierarchy of the visual objects that are exposed in WPF.

Visual class hierarchy

Diagram of classes derived from the Visual object

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 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