ItemsControl.ItemContainerGenerator Property
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Gets the ItemContainerGenerator associated with this ItemsControl.
Assembly: System.Windows (in System.Windows.dll)
Property Value
Type: System.Windows.Controls.ItemContainerGeneratorThe ItemContainerGenerator associated with this ItemsControl.
You can use the ItemContainerGenerator to retrieve items based on their index or containers by specifying the data item. For example, if you have a data-bound ItemsControl, and you want to obtain an item based on its index, you can use the ItemContainerGenerator.ContainerFromIndex method. If you want to retrieve the data item, use ItemContainerGenerator.ItemFromContainer method.