ItemContainerGenerator 類別

定義

提供 ItemsControl 專案與其容器元素之間的對應。

public ref class ItemContainerGenerator sealed
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.UI.Xaml.WinUIContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class ItemContainerGenerator final
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.UI.Xaml.WinUIContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class ItemContainerGenerator
Public NotInheritable Class ItemContainerGenerator
繼承
Object Platform::Object IInspectable ItemContainerGenerator
屬性

備註

您可以將 ItemContainerGenerator 設定為 ItemsControl.ItemContainerGenerator 属性的值。

方法

ContainerFromIndex(Int32)

注意

Windows 8.1 之後,可能會變更或無法使用 ContainerFromIndex。 請改用 ItemsControl.ContainerFromIndex

傳回 ItemCollection 內指定索引處之專案的容器。

ContainerFromItem(Object)

注意

Windows 8.1 之後,可能會變更或無法使用 ContainerFromItem。 請改用 ItemsControl.ContainerFromItem

傳回對應至指定專案的容器。

GenerateNext(Boolean)

傳回用來顯示下一個專案的容器元素,並指出容器元素是否已在 (實現) 。

GeneratorPositionFromIndex(Int32)

取得專案在指定索引處的產生位置。

GetItemContainerGeneratorForPanel(Panel)

會傳回適合指定面板使用的 ItemContainerGenerator

IndexFromContainer(DependencyObject)

注意

Windows 8.1 之後,可能會變更或無法使用 IndexFromContainer 版本。 請改用 ItemsControl.IndexFromContainer

將索引傳回至具有指定之產生的容器的專案。

IndexFromGeneratorPosition(GeneratorPosition)

傳回對應至指定 GeneratorPosition 的索引。

ItemFromContainer(DependencyObject)

注意

ItemFromContainer 可能會在 Windows 8.1 之後變更或無法使用發行。 請改用 ItemsControl.ItemFromContainer

傳回對應至指定之產生的容器的專案。

PrepareItemContainer(DependencyObject)

準備指定的項目 (element),做為對應項目 (item) 的容器。

Recycle(GeneratorPosition, Int32)

解除項目容器與其資料項目的關聯並且儲存容器,讓容器可以稍後供其他資料項目重複使用。

Remove(GeneratorPosition, Int32)

移除一個或多個產生 (實現) 的項目。

RemoveAll()

移除所有產生 (實現) 的項目。

StartAt(GeneratorPosition, GeneratorDirection, Boolean)

準備產生器以產生專案,從指定的 GeneratorPosition 開始,並在指定的 GeneratorDirection 中移動。 這個方法也會控制是否要從產生的 (實現) 項目開始。

Stop()

處置 ItemContainerGenerator

事件

ItemsChanged

發生於專案集合的內容變更時。

適用於

另請參閱