Skip to main content

Add Method

Adds an item to the ItemsControl.

Definition

Namespace: Avalonia.Controls
Assembly: Avalonia.Controls (in Avalonia.Controls.dll)

public int Add(
Object? value
)

Parameters

  Object
The item to add to the collection.

Return Value

Int32
The position into which the new element was inserted, or -1 to indicate that the item was not inserted into the collection.

Exceptions

InvalidOperationExceptionThe collection is in ItemsSource mode.

See Also

Reference

ItemCollection Class
Avalonia.Controls Namespace