In This Article

CustomDrawElement Class

Represents a UIElement that is capable of being custom drawn via the handling of its CustomDraw event.

public class CustomDrawElement : FrameworkElement
Inheritance:
object Visual UIElement FrameworkElement object

Remarks

For detailed documentation on this control's features and how to use them, please see the CustomDrawElement documentation topic.

Constructors

CustomDrawElement()

Initializes an instance of the class.

public CustomDrawElement()

Methods

GetLayoutClip(Size)

Returns a geometry for a clipping mask.

protected override Geometry GetLayoutClip(Size layoutSlotSize)
Parameter Type Description
layoutSlotSize Size

The layout slot size.

Returns

Geometry:

The clipping mask geometry.

OnCustomDraw(DrawingContext)

Raises the CustomDraw event.

protected virtual void OnCustomDraw(DrawingContext drawingContext)
Parameter Type Description
drawingContext DrawingContext

The DrawingContext to use.

OnRender(DrawingContext)

When overridden in a derived class, participates in rendering operations that are directed by the layout system. The rendering instructions for this element are not used directly when this method is invoked, and are instead preserved for later asynchronous use by layout and drawing.

protected override void OnRender(DrawingContext drawingContext)
Parameter Type Description
drawingContext DrawingContext

The drawing instructions for a specific element. This context is provided to the layout system.

Events

CustomDraw

Occurs when the element requests to be custom drawn.

public event EventHandler<CustomDrawElementCustomDrawEventArgs> CustomDraw

Event Type

EventHandler<CustomDrawElementCustomDrawEventArgs>

Fields

CustomDrawEvent

Identifies the CustomDraw routed event. This field is read-only.

public static readonly RoutedEvent CustomDrawEvent