Skip to main content

IChildIndexProvider Interface

Child's index and total count information provider used by list-controls (ListBox, StackPanel, etc.)

Definition​

Namespace: Avalonia.LogicalTree
Assembly: Avalonia.Base (in Avalonia.Base.dll)

public interface IChildIndexProvider
View Source

Remarks​

Used by nth-child and nth-last-child selectors.

Methods​

GetChildIndex(ILogical)Gets child's actual index in order of the original source.
TryGetTotalCount(Int32)Total children count or null if source is infinite. Some Avalonia features might not work if TryGetTotalCount(Int32) returns false, for instance: nth-last-child selector.

Events​

ChildIndexChangedNotifies subscriber when a child's index was changed.

See Also​

Reference​

Avalonia.LogicalTree Namespace