IItemContainerProvider 介面

定義

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

public interface class IItemContainerProvider
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.Guid(4015839301, 57812, 16628, 186, 213, 199, 250, 212, 74, 112, 62)]
struct IItemContainerProvider
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.Guid(4015839301, 57812, 16628, 186, 213, 199, 250, 212, 74, 112, 62)]
public interface IItemContainerProvider
Public Interface IItemContainerProvider
衍生
屬性

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)

備註

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

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

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

方法

FindItemByProperty(IRawElementProviderSimple, AutomationProperty, Object)

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

適用於

另請參閱