GeneratorPosition Struktura
Ważne
Niektóre informacje odnoszą się do produktu w wersji wstępnej, który może zostać znacząco zmodyfikowany przed wydaniem. Firma Microsoft nie udziela żadnych gwarancji, jawnych lub domniemanych, w odniesieniu do informacji podanych w tym miejscu.
GeneratorPosition służy do opisywania pozycji elementu zarządzanego przez ItemContainerGeneratorprogram .
public value class GeneratorPosition
public struct GeneratorPosition
type GeneratorPosition = struct
Public Structure GeneratorPosition
- Dziedziczenie
W poniższym przykładzie pokazano, jak za pomocą polecenia GeneratorPosition rozpocząć generowanie dalej od początku listy elementów.
// 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)
W poniższym przykładzie pokazano, jak użyć GeneratorPosition polecenia , aby rozpocząć generowanie wstecz od końca listy elementów.
// 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)
W poniższym przykładzie pokazano, jak za pomocą polecenia GeneratorPosition rozpocząć generowanie dalej na środku listy elementów.
// 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)
GeneratorPositionjest używany przez .StartAt
Generator |
Inicjuje nowe wystąpienie GeneratorPosition z określonym indeksem i przesunięciem. |
Index |
Pobiera lub ustawia Int32 indeks względem wygenerowanych (zrealizowanych) elementów. |
Offset |
Pobiera lub ustawia Int32 przesunięcie względem niegenerowanych (niezrealizowanych) elementów w pobliżu indeksowanego elementu. |
Equals(Object) |
Porównuje określone wystąpienie i bieżące wystąpienie GeneratorPosition elementu dla równości wartości. |
Get |
Zwraca kod skrótu dla tego GeneratorPosition. |
To |
Zwraca reprezentację ciągu tego wystąpienia klasy GeneratorPosition. |
Equality(Generator |
Porównuje dwa GeneratorPosition obiekty pod kątem równości wartości. |
Inequality(Generator |
Porównuje dwa GeneratorPosition obiekty pod kątem nierówności wartości. |
Produkt | Wersje |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
Opinia o produkcie .NET
.NET to projekt typu open source. Wybierz link, aby przekazać opinię: