FindDataTemplate Method
Find a data template that matches a piece of data.
Definition
Namespace: Avalonia.Controls.Templates
Assembly: Avalonia.Controls (in Avalonia.Controls.dll)
- C#
- VB
- F#
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
Parameters
- Control
- The control searching for the data template.
- Object
- The data.
- 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
Reference
DataTemplateExtensions Class
Avalonia.Controls.Templates Namespace