共用方式為


PropertyCollection Class

Definition

Allows property owners to control the lifetimes of the properties in the collection.

public ref class PropertyCollection
[Windows::Foundation::Metadata::WebHostHidden]
class PropertyCollection
public class PropertyCollection
type PropertyCollection = class
Public Class PropertyCollection
Inheritance
PropertyCollection

Remarks

This collection is synchronized in order to allow access by multiple threads.

Constructors

PropertyCollection()

Initializes a new instance of PropertyCollection.

Properties

Item[Object]

Gets or sets the Object with the specified key.

PropertyList

Returns the property collection as a read-only collection.

Methods

AddProperty(Object, Object)

Adds a new property to the collection.

CompareExchange<T>(Object, T, T)

Compares the entry associated with key for equality with value and, if they are Equals(Object, Object), replaces the entry with value. This is done as a thread-safe/atomic operation.

ContainsProperty(Object)

Determines whether the property collection contains a property for the specified key.

Exchange<T>(Object, T)

Replaces the entry associated with key with value, returning the old value (or default(T)). This is done as a thread-safe/atomic operation.

GetOrCreateSingletonProperty<T>(Func<T>)

Gets or creates a property of type T from the property collection. If there is already a property of that type, it returns the existing property. Otherwise, it uses creator to create an instance of that type.

GetOrCreateSingletonProperty<T>(Object, Func<T>)

Gets or creates a property of type T from the property collection. If there is already a property with the specified key, returns the existing property. Otherwise, uses creator to create an instance of that type and add it to the collection with the specified key.

GetProperty(Object)

Gets the property associated with the specified key.

GetProperty<TProperty>(Object)

Gets the property associated with the specified key.

RemoveProperty(Object)

Removes the property associated with the specified key.

TryGetProperty<TProperty>(Object, TProperty)

Gets the property associated with the specified key.

Applies to