Skip to main content

TreeDataGridPresenterBase<TItem> Class

Definition

Assembly:Avalonia.Controls.TreeDataGrid
Package:Avalonia.Controls.TreeDataGrid

Base class for virtualized presenters used in Avalonia.Controls.TreeDataGrid to display rows and columns.

public class TreeDataGridPresenterBase<TItem>

Inheritance: Border -> TreeDataGridPresenterBase<TItem>

Remarks

TreeDataGridPresenterBase implements virtualization, for TreeDataGrid's column and row presenters.

This class handles:

Derived classes must implement abstract methods to handle item-specific realization, un-realization, and element index updates. They must also specify the orientation in which items are laid out.

Methods

NameDescription
BringIntoViewNo summary available.
GetRealizedElementsGets all currently realized elements.
TryGetElementAttempts to get the element at the specified index.

BringIntoView Method

public Avalonia.Controls.Control BringIntoView(int index, Nullable<Avalonia.Rect> rect)

Parameters

index int

rect Nullable<Avalonia.Rect>

Returns

Avalonia.Controls.Control

GetRealizedElements Method

Gets all currently realized elements.

public System.Collections.Generic.IEnumerable<Avalonia.Controls.Control> GetRealizedElements()

Returns

System.Collections.Generic.IEnumerable<Avalonia.Controls.Control>

TryGetElement Method

Attempts to get the element at the specified index.

public Avalonia.Controls.Control TryGetElement(int index)

Parameters

index int

The index of the item.

Returns

Avalonia.Controls.Control

Remarks

This method returns the element only if it is currently realized. If the item at the specified index is not currently visible, this method returns null.

Properties

NameDescription
ElementFactoryGets or sets the factory used to create and recycle UI elements.
ItemContainerThemeGets or sets the theme applied to item containers.
ItemsGets or sets the items to be presented.

ElementFactory Property

Gets or sets the factory used to create and recycle UI elements.

public Avalonia.Controls.Primitives.TreeDataGridElementFactory ElementFactory { get; set; }

Value

The element factory used by this presenter.

Remarks

The element factory is responsible for creating visual elements to represent data items, and for recycling those elements when they are no longer needed.

ItemContainerTheme Property

Gets or sets the theme applied to item containers.

public Avalonia.Styling.ControlTheme ItemContainerTheme { get; set; }

Value

The theme to apply to item containers, or null to use the default theme.

Remarks

This theme is applied to the UI elements created by the presenter to represent items.

Items Property

Gets or sets the items to be presented.

public System.Collections.Generic.IReadOnlyList<TItem> Items { get; set; }

Value

A read-only list of items.

Remarks

When this property is set, the presenter will update its visual representation and start listening for changes in the collection if it implements System.Collections.Specialized.INotifyCollectionChanged.

Fields

ElementFactoryProperty Field

Defines the Avalonia.Controls.Primitives.TreeDataGridPresenterBase<T>.ElementFactory property.

public Avalonia.DirectProperty<Avalonia.Controls.Primitives.TreeDataGridPresenterBase<TItem><TItem>, Avalonia.Controls.Primitives.TreeDataGridElementFactory> ElementFactoryProperty

ItemContainerThemeProperty Field

Defines the Avalonia.Controls.Primitives.TreeDataGridPresenterBase<T>.ItemContainerTheme property.

public Avalonia.StyledProperty<Avalonia.Styling.ControlTheme> ItemContainerThemeProperty

ItemsProperty Field

Defines the Avalonia.Controls.Primitives.TreeDataGridPresenterBase<T>.Items property.

public Avalonia.DirectProperty<Avalonia.Controls.Primitives.TreeDataGridPresenterBase<TItem><TItem>, System.Collections.Generic.IReadOnlyList<TItem>> ItemsProperty