IItemContainerProvider 介面

定義

公開 Microsoft UI 自動化方法,讓應用程式能夠在容器中尋找專案,例如虛擬化清單。 實作此介面,以支援自動化用戶端使用 AutomationPeer.GetPattern 呼叫和 PatternInterface.ItemContainer要求的功能。

public interface class IItemContainerProvider
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.UI.Xaml.WinUIContract, 65536)]
/// [Windows.Foundation.Metadata.Guid(2905174883, 26958, 22661, 153, 125, 162, 214, 223, 244, 21, 167)]
struct IItemContainerProvider
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.UI.Xaml.WinUIContract), 65536)]
[Windows.Foundation.Metadata.Guid(2905174883, 26958, 22661, 153, 125, 162, 214, 223, 244, 21, 167)]
public interface IItemContainerProvider
Public Interface IItemContainerProvider
衍生
屬性

備註

包含大量子專案的控制項可以使用虛擬化有效率地管理專案。 透過虛擬化,控制項會針對任何指定時間只保留一部分專案記憶體中的完整資訊。 一般而言,子集只包含使用者目前可見的專案。 剩餘虛擬化專案的完整資訊會保留在儲存體中,並載入記憶體或實現,例如,控制項需要它,例如,當使用者看到新專案時。 相關的模式是 IVirtualizedItemProvider。 如需此模式用途的詳細資訊,請參閱 ItemContainer 控制項模式

IItemContainerProvider 是由現有Windows 執行階段自動化對等針對各種清單控制項或檢視實作,這些控制項會共用基類ItemsControl。 每個對等都繼承自 ItemsControlAutomationPeer而 ItemsControlAutomationPeer 提供常見的 Microsoft.UI.Xaml.Automation.Peers.ItemsControlAutomationPeer.FindItemByProperty 實作

IItemContainerProvider 模式沒有模式屬性識別碼類別,唯一實作的 API 是 FindItemByProperty,這是方法。

方法

FindItemByProperty(IRawElementProviderSimple, AutomationProperty, Object)

依指定的屬性值擷取項目。

適用於

另請參閱