ItemContainerGenerator ItemContainerGenerator ItemContainerGenerator ItemContainerGenerator Class

Definition

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

public : sealed class ItemContainerGenerator : IItemContainerGenerator
struct winrt::Windows::UI::Xaml::Controls::ItemContainerGenerator : IItemContainerGenerator
public sealed class ItemContainerGenerator : IItemContainerGenerator
Public NotInheritable Class ItemContainerGenerator Implements IItemContainerGenerator
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

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

Methods

ContainerFromIndex(Int32) ContainerFromIndex(Int32) ContainerFromIndex(Int32) 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) ContainerFromItem(Object) ContainerFromItem(Object) 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) GenerateNext(Boolean) GenerateNext(Boolean) 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) GeneratorPositionFromIndex(Int32) GeneratorPositionFromIndex(Int32) GeneratorPositionFromIndex(Int32)

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

GetItemContainerGeneratorForPanel(Panel) GetItemContainerGeneratorForPanel(Panel) GetItemContainerGeneratorForPanel(Panel) GetItemContainerGeneratorForPanel(Panel)

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

IndexFromContainer(DependencyObject) IndexFromContainer(DependencyObject) IndexFromContainer(DependencyObject) 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) IndexFromGeneratorPosition(GeneratorPosition) IndexFromGeneratorPosition(GeneratorPosition) IndexFromGeneratorPosition(GeneratorPosition)

Returns the index that maps to the specified GeneratorPosition.

ItemFromContainer(DependencyObject) ItemFromContainer(DependencyObject) ItemFromContainer(DependencyObject) 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) PrepareItemContainer(DependencyObject) PrepareItemContainer(DependencyObject) PrepareItemContainer(DependencyObject)

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

Recycle(GeneratorPosition, Int32) Recycle(GeneratorPosition, Int32) Recycle(GeneratorPosition, Int32) 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) Remove(GeneratorPosition, Int32) Remove(GeneratorPosition, Int32) Remove(GeneratorPosition, Int32)

Removes one or more generated (realized) items.

RemoveAll() RemoveAll() RemoveAll() RemoveAll()

Removes all generated (realized) items.

StartAt(GeneratorPosition, GeneratorDirection, Boolean) StartAt(GeneratorPosition, GeneratorDirection, Boolean) StartAt(GeneratorPosition, GeneratorDirection, Boolean) 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() Stop() Stop() Stop()

Disposes the ItemContainerGenerator.

Events

ItemsChanged ItemsChanged ItemsChanged ItemsChanged

Occurs when the contents of the items collection changes.

See Also