CreateContainer Method
Creates a new container control.
Definition
Namespace: Avalonia.Controls.Generators
Assembly: Avalonia.Controls (in Avalonia.Controls.dll)
- C#
- VB
- F#
public Control CreateContainer(
Object? item,
int index,
Object? recycleKey
)
Public Function CreateContainer (
item As Object,
index As Integer,
recycleKey As Object
) As Control
member CreateContainer :
item : Object *
index : int *
recycleKey : Object -> Control
Parameters
- Object
- The item to display.
- Int32
- The index of the item.
- Object
- The recycle key returned from NeedsContainer(Object, Int32, Object)
Return Value
Control
The newly created container control.
Remarks
Before calling this method, NeedsContainer(Object, Int32, Object) should be called to determine whether the item itself should be used as a container. After calling this method, PrepareItemContainer(Control, Object, Int32) must be called to prepare the container to display the specified item. If the panel supports recycling then the returned recycle key should be stored alongside the container and when container becomes eligible for recycling the container should be placed in a recycle pool using this key. If the returned recycle key is null then the container cannot be recycled.
See Also
Reference
ItemContainerGenerator Class
Avalonia.Controls.Generators Namespace