ItemContainerGenerator
ItemContainerGenerator
ItemContainerGenerator
ItemContainerGenerator
Class
Definition
Provides mappings between the items of an ItemsControl and their container elements.
public : sealed class ItemContainerGenerator : IItemContainerGeneratorpublic sealed class ItemContainerGenerator : IItemContainerGeneratorPublic NotInheritable Class ItemContainerGenerator Implements IItemContainerGenerator// This API is not available in Javascript.
- Attributes
| 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.
public : DependencyObject ContainerFromIndex(int index)public DependencyObject ContainerFromIndex(Int32 index)Public Function ContainerFromIndex(index As Int32) As DependencyObject// This API is not available in Javascript.
- index
- int Int32 Int32 Int32
The index of the item to retrieve.
The container for the item at the specified index within the item collection, if the item has a container; otherwise, null.
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.
public : DependencyObject ContainerFromItem(PlatForm::Object item)public DependencyObject ContainerFromItem(Object item)Public Function ContainerFromItem(item As Object) As DependencyObject// This API is not available in Javascript.
- item
- PlatForm::Object Object Object Object
The item to retrieve the container for.
A container that corresponds to the specified item, if the item has a container and exists in the collection; otherwise, null.
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).
public : DependencyObject GenerateNext(bool isNewlyRealized)public DependencyObject GenerateNext(Boolean isNewlyRealized)Public Function GenerateNext(isNewlyRealized As Boolean) As DependencyObject// This API is not available in Javascript.
- isNewlyRealized
- bool Boolean Boolean Boolean
true if the returned DependencyObject is newly generated (realized); otherwise, false.
A DependencyObject that is the container element that is used to display the next item.
GeneratorPositionFromIndex(Int32) GeneratorPositionFromIndex(Int32) GeneratorPositionFromIndex(Int32) GeneratorPositionFromIndex(Int32)
Gets the generated position of the item at the specified index.
public : GeneratorPosition GeneratorPositionFromIndex(int itemIndex)public GeneratorPosition GeneratorPositionFromIndex(Int32 itemIndex)Public Function GeneratorPositionFromIndex(itemIndex As Int32) As GeneratorPosition// This API is not available in Javascript.
- itemIndex
- int Int32 Int32 Int32
The index of the item to retrieve the position of.
The position of the item as generated by the ItemContainerGenerator.
GetItemContainerGeneratorForPanel(Panel) GetItemContainerGeneratorForPanel(Panel) GetItemContainerGeneratorForPanel(Panel) GetItemContainerGeneratorForPanel(Panel)
Returns the ItemContainerGenerator that is appropriate for use by the specified panel.
public : ItemContainerGenerator GetItemContainerGeneratorForPanel(Panel panel)public ItemContainerGenerator GetItemContainerGeneratorForPanel(Panel panel)Public Function GetItemContainerGeneratorForPanel(panel As Panel) As ItemContainerGenerator// This API is not available in Javascript.
The panel for which to return an appropriate ItemContainerGenerator.
An ItemContainerGenerator 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.
public : int IndexFromContainer(DependencyObject container)public int IndexFromContainer(DependencyObject container)Public Function IndexFromContainer(container As DependencyObject) As int// This API is not available in Javascript.
The generated container to retrieve the item index for.
The index to the item that corresponds to the specified generated container.
IndexFromGeneratorPosition(GeneratorPosition) IndexFromGeneratorPosition(GeneratorPosition) IndexFromGeneratorPosition(GeneratorPosition) IndexFromGeneratorPosition(GeneratorPosition)
Returns the index that maps to the specified GeneratorPosition.
public : int IndexFromGeneratorPosition(GeneratorPosition position)public int IndexFromGeneratorPosition(GeneratorPosition position)Public Function IndexFromGeneratorPosition(position As GeneratorPosition) As int// This API is not available in Javascript.
The GeneratorPosition for the desired index.
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.
public : PlatForm::Object ItemFromContainer(DependencyObject container)public object ItemFromContainer(DependencyObject container)Public Function ItemFromContainer(container As DependencyObject) As object// This API is not available in Javascript.
The DependencyObject that corresponds to the item to be returned.
The contained item, or the container if it does not contain an item.
PrepareItemContainer(DependencyObject) PrepareItemContainer(DependencyObject) PrepareItemContainer(DependencyObject) PrepareItemContainer(DependencyObject)
Prepares the specified element as the container for the corresponding item.
public : void PrepareItemContainer(DependencyObject container)public void PrepareItemContainer(DependencyObject container)Public Function PrepareItemContainer(container As DependencyObject) As void// This API is not available in Javascript.
The container to prepare. Typically, container is the result of the previous call to GenerateNext.
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.
public : void Recycle(GeneratorPosition position, int count)public void Recycle(GeneratorPosition position, Int32 count)Public Function Recycle(position As GeneratorPosition, count As Int32) As void// This API is not available in Javascript.
The zero-based index of the first element to reuse. position must refer to a previously generated (realized) item.
- count
- int Int32 Int32 Int32
The number of elements to reuse, starting at position.
Remove(GeneratorPosition, Int32) Remove(GeneratorPosition, Int32) Remove(GeneratorPosition, Int32) Remove(GeneratorPosition, Int32)
Removes one or more generated (realized) items.
public : void Remove(GeneratorPosition position, int count)public void Remove(GeneratorPosition position, Int32 count)Public Function Remove(position As GeneratorPosition, count As Int32) As void// This API is not available in Javascript.
The index of the element to remove. position must refer to a previously generated (realized) item, which means its offset must be zero.
- count
- int Int32 Int32 Int32
The number of elements to remove, starting at position.
RemoveAll() RemoveAll() RemoveAll() RemoveAll()
Removes all generated (realized) items.
public : void RemoveAll()public void RemoveAll()Public Function RemoveAll() As void// This API is not available in Javascript.
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.
public : void StartAt(GeneratorPosition position, GeneratorDirection direction, bool allowStartAtRealizedItem)public void StartAt(GeneratorPosition position, GeneratorDirection direction, Boolean allowStartAtRealizedItem)Public Function StartAt(position As GeneratorPosition, direction As GeneratorDirection, allowStartAtRealizedItem As Boolean) As void// This API is not available in Javascript.
A GeneratorPosition that specifies the position of the item to start generating items at.
Specifies the position of the item to start generating items at.
- allowStartAtRealizedItem
- bool Boolean Boolean Boolean
Specifies whether to start at a generated (realized) item.
Stop() Stop() Stop() Stop()
Disposes the ItemContainerGenerator.
public : void Stop()public void Stop()Public Function Stop() As void// This API is not available in Javascript.