DataTemplateExtensionsFindDataTemplate Method

Find a data template that matches a piece of data.

Definition

Namespace: Avalonia.Controls.Templates
Assembly: Avalonia.Controls (in Avalonia.Controls.dll) Version: 11.3.999
public static IDataTemplate? FindDataTemplate(
	this Control control,
	Object data,
	IDataTemplate primary = null
)

Parameters

control  Control
The control searching for the data template.
data  Object
The data.
primary  IDataTemplate  (Optional)
An optional primary template that can will be tried before the DataTemplates in the tree are searched.

Return Value

IDataTemplate
The data template or null if no matching data template was found.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Control. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also