Table of Contents

Class FuncTreeDataTemplate

Namespace
Avalonia.Controls.Templates
Assembly
Avalonia.Controls.dll

A template used to build hierarchical data.

public class FuncTreeDataTemplate : FuncDataTemplate, IRecyclingDataTemplate, ITreeDataTemplate, IDataTemplate, ITemplate<object?, Control?>
Inheritance
FuncTreeDataTemplate
Implements
Derived
Inherited Members

Constructors

FuncTreeDataTemplate(Func<object?, bool>, Func<object?, INameScope, Control?>, Func<object?, IEnumerable>)

Initializes a new instance of the FuncTreeDataTemplate class.

public FuncTreeDataTemplate(Func<object?, bool> match, Func<object?, INameScope, Control?> build, Func<object?, IEnumerable> itemsSelector)

Parameters

match Func<object, bool>

A function which determines whether the data template matches the specified data.

build Func<object, INameScope, Control>

A function which when passed a matching object returns a control.

itemsSelector Func<object, IEnumerable>

A function which when passed a matching object returns the child items.

FuncTreeDataTemplate(Type, Func<object?, INameScope, Control>, Func<object?, IEnumerable>)

Initializes a new instance of the FuncTreeDataTemplate class.

public FuncTreeDataTemplate(Type type, Func<object?, INameScope, Control> build, Func<object?, IEnumerable> itemsSelector)

Parameters

type Type

The type of data which the data template matches.

build Func<object, INameScope, Control>

A function which when passed an object of type returns a control.

itemsSelector Func<object, IEnumerable>

A function which when passed an object of type returns the child items.

Methods

ItemsSelector(object)

Selects the child items of an item.

public InstancedBinding ItemsSelector(object item)

Parameters

item object

The item.

Returns

InstancedBinding

The child items, or null if no child items.