FindDataTemplate(IControl, object, IDataTemplate) Method


Find a data template that matches a piece of data.


public static IDataTemplate FindDataTemplate(this IControl control, object data, IDataTemplate primary = null)


Name Type Description
control IControl The control searching for the data template.
data object The data.
primary IDataTemplate An optional primary template that can will be tried before the DataTemplates in the tree are searched.

Return Value

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