AttachablePropertyServices Class

Provides static helper methods that obtain values and accessor method information from an attachable property and that work with an attached property store.

System.Object
  System.Xaml.AttachablePropertyServices

Namespace:  System.Xaml
Assembly:  System.Xaml (in System.Xaml.dll)

public static class AttachablePropertyServices

The AttachablePropertyServices type exposes the following members.

  NameDescription
Public methodStatic memberCopyPropertiesToCopies all attachable property/value pairs from a specified attachable property store and into a destination array.
Public methodStatic memberGetAttachedPropertyCountReturns the count of the attachable property entries that are in the specified store.
Public methodStatic memberRemovePropertyRemoves the entry for the specified attachable property from the specified store.
Public methodStatic memberSetPropertySets a value for the specified attachable property in the specified store.
Public methodStatic memberTryGetProperty(Object, AttachableMemberIdentifier, Object)Attempts to get a value for the specified attachable property in the specified store. Does not throw an exception if the specific attachable property does not exist in the store.
Public methodStatic memberTryGetProperty<T>(Object, AttachableMemberIdentifier, T)Attempts to get a value for the specified attachable property in the specified store, returning a generic output form. Does not throw an exception if the specific attachable property does not exist in the store.
Top

Most functionality in this class relies on an attached property store, which generally implements the IAttachedPropertyStore interface. However, parameters for passing the store into AttachablePropertyServices are not typed as the interface and are instead typed as object. This is because you can pass an arbitrary object, and in this case, an internal default attachable property store is used.

Best practice for the arbitrary object is to pass the object that would otherwise be associated with the store. Do not pass null to indicate that you do not have an IAttachedPropertyStore to use. Passing null enters code paths that do nothing. Passing an object that is non-null, but evaluates as null on an attempted IAttachedPropertyStore cast, uses the default attachable property store.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4

.NET Framework Client Profile

Supported in: 4

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft