DataTemplateExtensionsFindDataTemplate Method
Find a data template that matches a piece of data.
Namespace: Avalonia.Controls.TemplatesAssembly: Avalonia.Controls (in Avalonia.Controls.dll) Version: 11.3.999
public static IDataTemplate? FindDataTemplate(
this Control control,
Object data,
IDataTemplate primary = null
)
<ExtensionAttribute>
Public Shared Function FindDataTemplate (
control As Control,
data As Object,
Optional primary As IDataTemplate = Nothing
) As IDataTemplate
[<ExtensionAttribute>]
static member FindDataTemplate :
control : Control *
data : Object *
?primary : IDataTemplate
(* Defaults:
let _primary = defaultArg primary null
*)
-> IDataTemplate
- 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.
IDataTemplateThe data template or null if no matching data template was found.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).