UIElementWeakCollection 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
表示对 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)
- 继承
- 属性
- 实现
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 值。 |