Share via


ItemContainerGenerator Class

Definition

Provides mappings between the items of an ItemsControl and their container elements.

public ref class ItemContainerGenerator sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class ItemContainerGenerator final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class ItemContainerGenerator final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class ItemContainerGenerator
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class ItemContainerGenerator
Public NotInheritable Class ItemContainerGenerator
Inheritance
Object Platform::Object IInspectable ItemContainerGenerator
Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Remarks

You set an ItemContainerGenerator as the value of the ItemsControl.ItemContainerGenerator property.

Methods

ContainerFromIndex(Int32)

Note

ContainerFromIndex may be altered or unavailable for releases after Windows 8.1. Instead, use ItemsControl.ContainerFromIndex.

Returns the container for the item at the specified index within the ItemCollection.

ContainerFromItem(Object)

Note

ContainerFromItem may be altered or unavailable for releases after Windows 8.1. Instead, use ItemsControl.ContainerFromItem.

Returns the container corresponding to the specified item.

GenerateNext(Boolean)

Returns the container element used to display the next item, and indicates whether the container element has been newly generated (realized).

GeneratorPositionFromIndex(Int32)

Gets the generated position of the item at the specified index.

GetItemContainerGeneratorForPanel(Panel)

Returns the ItemContainerGenerator that is appropriate for use by the specified panel.

IndexFromContainer(DependencyObject)

Note

IndexFromContainer may be altered or unavailable for releases after Windows 8.1. Instead, use ItemsControl.IndexFromContainer.

Returns the index to the item that has the specified, generated container.

IndexFromGeneratorPosition(GeneratorPosition)

Returns the index that maps to the specified GeneratorPosition.

ItemFromContainer(DependencyObject)

Note

ItemFromContainer may be altered or unavailable for releases after Windows 8.1. Instead, use ItemsControl.ItemFromContainer.

Returns the item that corresponds to the specified, generated container.

PrepareItemContainer(DependencyObject)

Prepares the specified element as the container for the corresponding item.

Recycle(GeneratorPosition, Int32)

Disassociates item containers from their data items and saves the containers so they can be reused later for other data items.

Remove(GeneratorPosition, Int32)

Removes one or more generated (realized) items.

RemoveAll()

Removes all generated (realized) items.

StartAt(GeneratorPosition, GeneratorDirection, Boolean)

Prepares the generator to generate items, starting at the specified GeneratorPosition and moving in the specified GeneratorDirection. This method also controls whether or not to start at a generated (realized) item.

Stop()

Disposes the ItemContainerGenerator.

Events

ItemsChanged

Occurs when the contents of the items collection changes.

Applies to

See also