GeneratorPosition 구조체

정의

GeneratorPosition ItemContainerGenerator관리되는 항목의 위치를 설명하는 데 사용됩니다.

public value class GeneratorPosition
public struct GeneratorPosition
type GeneratorPosition = struct
Public Structure GeneratorPosition
상속
GeneratorPosition

예제

다음 예제에서는 항목 목록의 시작 부분에서 앞으로 생성을 시작 하는 데 사용 GeneratorPosition 하는 방법을 보여 줍니다.

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

다음 예제에서는 항목 목록의 끝에서 뒤로 생성을 시작 하는 데 사용 GeneratorPosition 하는 방법을 보여 줍니다.

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

다음 예제에서는 항목 목록의 중간에서 앞으로 생성을 시작 하는 데 사용 GeneratorPosition 하는 방법을 보여 줍니다.

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

설명

GeneratorPosition StartAt사용됩니다.

생성자

Name Description
GeneratorPosition(Int32, Int32)

지정된 인덱스 및 오프셋을 사용하여 새 인스턴스 GeneratorPosition 를 초기화합니다.

속성

Name Description
Index

생성된(실현된) 항목을 기준으로 하는 인덱스 가져오거나 설정합니다 Int32 .

Offset

인덱싱된 항목 근처의 생성되지 않은(실현되지 않은) 항목을 기준으로 하는 오프셋을 가져오거나 설정합니다 Int32 .

메서드

Name Description
Equals(Object)

지정된 인스턴스와 값 같음의 GeneratorPosition 현재 인스턴스를 비교합니다.

GetHashCode()

이에 GeneratorPosition대한 해시 코드를 반환합니다.

ToString()

이 인스턴스의 문자열 표현을 반환합니다 GeneratorPosition.

연산자

Name Description
Equality(GeneratorPosition, GeneratorPosition)

GeneratorPosition 개체를 값 같음과 비교합니다.

Inequality(GeneratorPosition, GeneratorPosition)

GeneratorPosition 개체를 값 같지 않음과 비교합니다.

적용 대상