Skip to main content

Build(Object, Control) Method

Creates or recycles a control to display the specified data.

Definition

Namespace: Avalonia.Controls.Templates
Assembly: Avalonia.Controls (in Avalonia.Controls.dll)

public Control? Build(
Object? data,
Control? existing
)

Parameters

  Object
The data to display.
  Control
An optional control to recycle.

Return Value

Control
The existing control if supplied and applicable to data, otherwise a new control or null.

Implements

IRecyclingDataTemplate.Build(Object, Control)

Remarks

The caller should ensure that any control passed to existing originated from the same data template.

See Also

Reference

FuncDataTemplate Class
Build Overload
Avalonia.Controls.Templates Namespace