Skip to main content

IChildIndexProvider Interface

Definition​

Assembly:Avalonia.Base
Package:Avalonia

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

public interface IChildIndexProvider

Remarks​

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

Methods​

NameDescription
GetChildIndexGets child's actual index in order of the original source.
TryGetTotalCountNo summary available.

GetChildIndex Method​

Gets child's actual index in order of the original source.

public int GetChildIndex(Avalonia.LogicalTree.ILogical child)

Parameters​

child Avalonia.LogicalTree.ILogical

Logical child.

Returns​

int

Index or -1 if child was not found.

TryGetTotalCount Method​

public bool TryGetTotalCount(int& count)

Parameters​

count int&

Returns​

bool

Events​

NameDescription
ChildIndexChangedNotifies subscriber when a child's index was changed.

ChildIndexChanged Event​

Notifies subscriber when a child's index was changed.

public event EventHandler<Avalonia.LogicalTree.ChildIndexChangedEventArgs> ChildIndexChanged