Class ItemContainerGenerator
An ItemContainerGenerator is responsible for generating the UI on behalf of
its host (e.g. ItemsControl). It maintains the association between the items in
the control's data view and the corresponding
UIElements. The control's item-host can ask the ItemContainerGenerator for
a Generator, which does the actual generation of UI.
Inheritance
System.Object
ItemContainerGenerator
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: OpenSilver.dll
Syntax
public sealed class ItemContainerGenerator : IRecyclingItemContainerGenerator, IItemContainerGenerator
Methods
|
Improve this Doc
View Source
ContainerFromIndex(Int32)
Return the UI element corresponding to the item at the given index
within the ItemCollection.
Declaration
public DependencyObject ContainerFromIndex(int index)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
Returns
|
Improve this Doc
View Source
ContainerFromItem(Object)
Return the UI element corresponding to the given item.
Returns null if the item does not belong to the item collection,
or if no UI has been generated for it.
Declaration
public DependencyObject ContainerFromItem(object item)
Parameters
Type |
Name |
Description |
System.Object |
item |
|
Returns
|
Improve this Doc
View Source
GeneratorPositionFromIndex(Int32)
Map an index into the items collection to a GeneratorPosition.
Declaration
public GeneratorPosition GeneratorPositionFromIndex(int itemIndex)
Parameters
Type |
Name |
Description |
System.Int32 |
itemIndex |
|
Returns
|
Improve this Doc
View Source
IndexFromContainer(DependencyObject)
Given a generated UI element, return the index of the corresponding item
within the ItemCollection.
Declaration
public int IndexFromContainer(DependencyObject container)
Parameters
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
IndexFromGeneratorPosition(GeneratorPosition)
Map a GeneratorPosition to an index into the items collection.
Declaration
public int IndexFromGeneratorPosition(GeneratorPosition position)
Parameters
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
ItemFromContainer(DependencyObject)
Return the item corresponding to the given UI element.
If the element was not generated as a container for this generator's
host, the method returns DependencyProperty.UnsetValue.
Declaration
public object ItemFromContainer(DependencyObject container)
Parameters
Returns
Type |
Description |
System.Object |
|
Events
|
Improve this Doc
View Source
ItemsChanged
The ItemsChanged event is raised by a ItemContainerGenerator to inform
layouts that the items collection has changed.
Declaration
public event ItemsChangedEventHandler ItemsChanged
Event Type
Explicit Interface Implementations
|
Improve this Doc
View Source
IItemContainerGenerator.GenerateNext(out Boolean)
Declaration
DependencyObject IItemContainerGenerator.GenerateNext(out bool isNewlyRealized)
Parameters
Type |
Name |
Description |
System.Boolean |
isNewlyRealized |
|
Returns
|
Improve this Doc
View Source
IItemContainerGenerator.GetItemContainerGeneratorForPanel(Panel)
Return the ItemContainerGenerator appropriate for use by the given panel
Declaration
ItemContainerGenerator IItemContainerGenerator.GetItemContainerGeneratorForPanel(Panel panel)
Parameters
Type |
Name |
Description |
Panel |
panel |
|
Returns
|
Improve this Doc
View Source
IItemContainerGenerator.PrepareItemContainer(DependencyObject)
Prepare the given element to act as the container for the
corresponding item. This includes applying the container style,
forwarding information from the host control (ItemTemplate, etc.),
and other small adjustments.
Declaration
void IItemContainerGenerator.PrepareItemContainer(DependencyObject container)
Parameters
Type |
Name |
Description |
DependencyObject |
container |
The container to prepare.
Normally this is the result of the previous call to GenerateNext.
|
|
Improve this Doc
View Source
IItemContainerGenerator.Remove(GeneratorPosition, Int32)
Remove generated elements.
Declaration
void IItemContainerGenerator.Remove(GeneratorPosition position, int count)
Parameters
|
Improve this Doc
View Source
IItemContainerGenerator.RemoveAll()
Remove all generated elements.
Declaration
void IItemContainerGenerator.RemoveAll()
|
Improve this Doc
View Source
IItemContainerGenerator.StartAt(GeneratorPosition, GeneratorDirection, Boolean)
Begin generating at the given position and direction
Declaration
IDisposable IItemContainerGenerator.StartAt(GeneratorPosition position, GeneratorDirection direction, bool allowStartAtRealizedItem)
Parameters
Returns
Type |
Description |
System.IDisposable |
|
|
Improve this Doc
View Source
IRecyclingItemContainerGenerator.Recycle(GeneratorPosition, Int32)
Declaration
void IRecyclingItemContainerGenerator.Recycle(GeneratorPosition position, int count)
Parameters
Implements
Extension Methods