GeneratorPosition Structure

 

GeneratorPosition is used to describe the position of an item that is managed by ItemContainerGenerator.

Namespace:   System.Windows.Controls.Primitives
Assembly:  PresentationFramework (in PresentationFramework.dll)

public struct GeneratorPosition

NameDescription
System_CAPS_pubmethodGeneratorPosition(Int32, Int32)

Initializes a new instance of GeneratorPosition with the specified index and offset.

NameDescription
System_CAPS_pubpropertyIndex

Gets or sets the Int32 index that is relative to the generated (realized) items.

System_CAPS_pubpropertyOffset

Gets or sets the Int32 offset that is relative to the ungenerated (unrealized) items near the indexed item.

NameDescription
System_CAPS_pubmethodEquals(Object)

Compares the specified instance and the current instance of GeneratorPosition for value equality.(Overrides ValueType.Equals(Object).)

System_CAPS_pubmethodGetHashCode()

Returns the hash code for this GeneratorPosition.(Overrides ValueType.GetHashCode().)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string representation of this instance of GeneratorPosition.(Overrides ValueType.ToString().)

NameDescription
System_CAPS_puboperatorSystem_CAPS_staticEquality(GeneratorPosition, GeneratorPosition)

Compares two GeneratorPosition objects for value equality.

System_CAPS_puboperatorSystem_CAPS_staticInequality(GeneratorPosition, GeneratorPosition)

Compares two GeneratorPosition objects for value inequality.

GeneratorPosition is used by StartAt.

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);

.NET Framework
Available since 3.0
Silverlight
Available since 3.0
Windows Phone Silverlight
Available since 7.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: