GeneratorPosition GeneratorPosition GeneratorPosition GeneratorPosition Struct

Definición

GeneratorPosition se utiliza para describir la posición de un elemento administrado por ItemContainerGenerator.GeneratorPosition is used to describe the position of an item that is managed by ItemContainerGenerator.

public value class GeneratorPosition
public struct GeneratorPosition
type GeneratorPosition = struct
Public Structure GeneratorPosition
Herencia
GeneratorPositionGeneratorPositionGeneratorPositionGeneratorPosition

Ejemplos

En el ejemplo siguiente se muestra cómo usar GeneratorPosition para empezar a generar hacia delante desde el principio de una lista de elementos.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);
' Start generating items forward from the beginning of the item list
Dim position As New GeneratorPosition(-1, 0)
Dim direction As GeneratorDirection = GeneratorDirection.Forward
Dim generator As IItemContainerGenerator = CType(Me.itemsControl.ItemContainerGenerator, IItemContainerGenerator)
generator.StartAt(position, direction)

En el ejemplo siguiente se muestra cómo usar GeneratorPosition para empezar a generar hacia atrás desde el final de una lista de elementos.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);
' Start generating items backward from the end of the item list
Dim position As New GeneratorPosition(-1, 0)
Dim direction As GeneratorDirection = GeneratorDirection.Backward
Dim generator As IItemContainerGenerator = CType(Me.itemsControl.ItemContainerGenerator, IItemContainerGenerator)
generator.StartAt(position, direction)

En el ejemplo siguiente se muestra cómo usar GeneratorPosition para empezar a generar hacia delante desde el centro de una lista de elementos.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);
' 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
Dim position As New GeneratorPosition(4, 1)
Dim direction As GeneratorDirection = GeneratorDirection.Forward
Dim generator As IItemContainerGenerator = CType(Me.itemsControl.ItemContainerGenerator, IItemContainerGenerator)
generator.StartAt(position, direction)

Comentarios

GeneratorPosition utiliza StartAt.GeneratorPosition is used by StartAt.

Constructores

GeneratorPosition(Int32, Int32) GeneratorPosition(Int32, Int32) GeneratorPosition(Int32, Int32) GeneratorPosition(Int32, Int32)

Inicializa una nueva instancia de GeneratorPosition con el índice y el desplazamiento especificados.Initializes a new instance of GeneratorPosition with the specified index and offset.

Propiedades

Index Index Index Index

Obtiene o establece el índice Int32 relativo a los elementos generados (realizados).Gets or sets the Int32 index that is relative to the generated (realized) items.

Offset Offset Offset Offset

Obtiene o establece el desplazamiento Int32 relativo a los elementos no generados (no realizados) cerca del elemento indizado.Gets or sets the Int32 offset that is relative to the ungenerated (unrealized) items near the indexed item.

Métodos

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Compara la instancia especificada y la instancia actual de GeneratorPosition para determinar si sus valores son iguales.Compares the specified instance and the current instance of GeneratorPosition for value equality.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Devuelve el código hash para esta estructura GeneratorPosition.Returns the hash code for this GeneratorPosition.

ToString() ToString() ToString() ToString()

Devuelve una representación de cadena de esta instancia de GeneratorPosition.Returns a string representation of this instance of GeneratorPosition.

Operadores

Equality(GeneratorPosition, GeneratorPosition) Equality(GeneratorPosition, GeneratorPosition) Equality(GeneratorPosition, GeneratorPosition) Equality(GeneratorPosition, GeneratorPosition)

Compara dos objetos GeneratorPosition para determinar si sus valores son iguales.Compares two GeneratorPosition objects for value equality.

Inequality(GeneratorPosition, GeneratorPosition) Inequality(GeneratorPosition, GeneratorPosition) Inequality(GeneratorPosition, GeneratorPosition) Inequality(GeneratorPosition, GeneratorPosition)

Compara dos objetos GeneratorPosition para determinar si sus valores no son iguales.Compares two GeneratorPosition objects for value inequality.

Se aplica a