Dela via


UIElementWeakCollection Class

Definition

Represents a collection of weak references to UIElement objects.

/// [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)
Inheritance
Object IInspectable UIElementWeakCollection
Attributes
Implements

Windows requirements

Device family
Windows 10, version 1903 (introduced in 10.0.18362.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v8.0)

Remarks

This class is used by the ThemeShadow.Receivers property.

Constructors

UIElementWeakCollection()

Initializes a new instance of the UIElementWeakCollection class.

Properties

Size

Gets the size (count) of the collection.

Methods

Append(UIElement)

Adds a new item to the collection.

Clear()

Removes all items from the collection.

First()

Returns an iterator for the items in the collection.

GetAt(UInt32)

Returns the item located at the specified index.

GetMany(UInt32, UIElement[])

Retrieves multiple elements in a single pass through the iterator.

GetView()

Gets an immutable view into the collection.

IndexOf(UIElement, UInt32)

Retrieves the index of the specified item.

InsertAt(UInt32, UIElement)

Inserts the specified item at the specified index.

RemoveAt(UInt32)

Removes the item at the specified index.

RemoveAtEnd()

Removes the last item in the collection.

ReplaceAll(UIElement[])

Initially clears the collection, then inserts the provided array as new items.

SetAt(UInt32, UIElement)

Sets the value at the specified index to the specified UIElement value.

Applies to

See also