GeneratorPosition GeneratorPosition GeneratorPosition GeneratorPosition Struct

Definição

GeneratorPosition é usado para descrever a posição de um item que é gerenciado 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
Herança
GeneratorPositionGeneratorPositionGeneratorPositionGeneratorPosition

Exemplos

O exemplo a seguir ilustra como usar GeneratorPosition para começar a gerar adiante desde o início de uma lista de itens.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)

O exemplo a seguir ilustra como usar GeneratorPosition para iniciar a geração de retrocesso a partir do final de uma lista de itens.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)

O exemplo a seguir ilustra como usar GeneratorPosition para iniciar a geração a partir do meio de uma lista de itens.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)

Comentários

GeneratorPosition é usado pelo StartAt.GeneratorPosition is used by StartAt.

Construtores

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

Inicializa uma nova instância de GeneratorPosition com o índice e o deslocamento especificados.Initializes a new instance of GeneratorPosition with the specified index and offset.

Propriedades

Index Index Index Index

Obtém ou define o índice Int32 relativo aos itens gerados (realizados).Gets or sets the Int32 index that is relative to the generated (realized) items.

Offset Offset Offset Offset

Obtém ou define o deslocamento Int32 relativo aos itens não gerados (não realizados) perto do item indexado.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 a instância especificada e a instância atual de GeneratorPosition quanto à igualdade de valores.Compares the specified instance and the current instance of GeneratorPosition for value equality.

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

Retorna o código hash para este GeneratorPosition.Returns the hash code for this GeneratorPosition.

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

Retorna uma representação de cadeia de caracteres dessa instância 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 dois objetos GeneratorPosition quanto à igualdade de valor.Compares two GeneratorPosition objects for value equality.

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

Compara dois objetos GeneratorPosition quanto à desigualdade de valor.Compares two GeneratorPosition objects for value inequality.

Aplica-se a