Search Results for

Show / Hide Table of Contents

# Interface ITreeBuilder<T>

Interface for supplying data to a TreeView<T> on demand as root level nodes are expanded by the user

###### Namespace: Terminal.Gui.Trees

###### Assembly: Terminal.Gui.dll

##### Syntax

    public interface ITreeBuilder<T>

##### Type Parameters

Name | Description
--- | ---
T |

### Properties

#### SupportsCanExpand

Returns true if CanExpand(T) is implemented by this class

##### Declaration

    bool SupportsCanExpand { get; }

##### Property Value

Type | Description
--- | ---
System.Boolean |

### Methods

#### CanExpand(T)

Returns true/false for whether a model has children. This method should be implemented when GetChildren(T) is an expensive operation otherwise SupportsCanExpand should return false (in which case this method will not be called)

##### Declaration

    bool CanExpand(T toExpand)

##### Parameters

Type | Name | Description
--- | --- | ---
T | toExpand |

##### Returns

Type | Description
--- | ---
System.Boolean |

#### GetChildren(T)

Returns all children of a given `forObject` which should be added to the tree as new branches underneath it

##### Declaration

    IEnumerable<T> GetChildren(T forObject)

##### Parameters

Type | Name | Description
--- | --- | ---
T | forObject |

##### Returns

Type | Description
--- | ---
System.Collections.Generic.IEnumerable<T> |