UIElementWeakCollection 類別

定義

表示 UIElement 物件的弱式參考集合。

/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 524288)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class UIElementWeakCollection : IIterable<UIElement>, IVector<UIElement>
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 524288)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public class UIElementWeakCollection : IEnumerable<UIElement>, IList<UIElement>
Public Class UIElementWeakCollection
Implements IEnumerable(Of UIElement), IList(Of UIElement)
繼承
Object IInspectable UIElementWeakCollection
屬性
實作

Windows 需求

裝置系列
Windows 10, version 1903 (已於 10.0.18362.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v8.0 引進)

備註

ThemeShadow.Receivers屬性會使用此類別。

建構函式

UIElementWeakCollection()

初始化 UIElementWeakCollection 類別的新實例。

屬性

Size

取得集合) 的大小 (計數。

方法

Append(UIElement)

將新項目加入至集合中。

Clear()

移除集合的所有項目。

First()

傳回集合中專案的反覆運算器。

GetAt(UInt32)

傳回位於指定索引處的專案。

GetMany(UInt32, UIElement[])

擷取單一傳遞反覆運算器中的多個專案。

GetView()

取得集合中的不可變檢視。

IndexOf(UIElement, UInt32)

擷取指定專案的索引。

InsertAt(UInt32, UIElement)

在指定的索引處插入指定的專案。

RemoveAt(UInt32)

移除指定之索引處的項目。

RemoveAtEnd()

移除集合中的最後一個專案。

ReplaceAll(UIElement[])

一開始會清除集合,然後將提供的陣列插入為新專案。

SetAt(UInt32, UIElement)

將位於指定索引處的值設定為指定的 UIElement 值。

適用於

另請參閱