New to Telerik UI for WinForms? Start a free 30-day trial

Tracks decoration visuals so they can be reset and returned to an object pool when the layer refreshes.

Definition

Constructors

Initializes the layer with the object pool used for its decoration visuals.

C#
public PooledDecorationUILayerBase(ObjectPool objPool)
Parameters:objPoolObjectPool

The pool used to create and release visual elements.

Methods

Resets a visual's transient properties and returns it to the pool.

C#
protected void AddElementToPool(object element)
Parameters:elementobject

The visual to reset and release.

Tracks a visual for later pooling and adds it to the decoration layer.

C#
protected void AddPooledDecorationElement(UIElement element)
Parameters:elementUIElement

The decoration visual to track and display.

Clears the displayed decorations and returns tracked visuals to the object pool.

C#
protected override void Clear()

Overrides: DecorationUILayerBase.Clear()

Creates a visual instance from the pool.

C#
protected T GetElementFromPool<T>() where T : class, new()
Returns:

T

A pooled instance of the requested type.

Resets layer-specific properties before a pooled visual is reused.

C#
protected abstract void ResetPooledElementProperties(object element)
Parameters:elementobject

The visual whose properties must be reset.