GeneratorPosition Structure
GeneratorPosition is used to describe the position of an item that is managed by ItemContainerGenerator.
Assembly: PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
The following example illustrates how to use GeneratorPosition to start generating forward from the beginning of an item list.
// Start generating items forward from the beginning of the item list GeneratorPosition position = new GeneratorPosition(-1, 0); GeneratorDirection direction = GeneratorDirection.Forward; IItemContainerGenerator generator = (IItemContainerGenerator)this.itemsControl.ItemContainerGenerator; generator.StartAt(position, direction);
The following example illustrates how to use GeneratorPosition to start generating backward from the end of an item list.
// Start generating items backward from the end of the item list GeneratorPosition position = new GeneratorPosition(-1, 0); GeneratorDirection direction = GeneratorDirection.Backward; IItemContainerGenerator generator = (IItemContainerGenerator)this.itemsControl.ItemContainerGenerator; generator.StartAt(position, direction);
The following example illustrates how to use GeneratorPosition to start generating forward from the middle of an item list.
// Start generating items forward, // starting with the first unrealized item (offset of 1), // after the 5th realized item // (the item with index 4 among all realized items) in the list GeneratorPosition position = new GeneratorPosition(4, 1); GeneratorDirection direction = GeneratorDirection.Forward; IItemContainerGenerator generator = (IItemContainerGenerator)this.itemsControl.ItemContainerGenerator; generator.StartAt(position, direction);
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.