AttachablePropertyServices Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides static helper methods that obtain values and accessor method information from an attachable property and that work with an attached property store.
public ref class AttachablePropertyServices abstract sealed
public static class AttachablePropertyServices
type AttachablePropertyServices = class
Public Class AttachablePropertyServices
- Inheritance
-
AttachablePropertyServices
Remarks
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.
Methods
CopyPropertiesTo(Object, KeyValuePair<AttachableMemberIdentifier,Object>[], Int32) |
Copies all attachable property/value pairs from a specified attachable property store and into a destination array. |
GetAttachedPropertyCount(Object) |
Returns the count of the attachable property entries that are in the specified store. |
RemoveProperty(Object, AttachableMemberIdentifier) |
Removes the entry for the specified attachable property from the specified store. |
SetProperty(Object, AttachableMemberIdentifier, Object) |
Sets a value for the specified attachable property in the specified store. |
TryGetProperty(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. |
TryGetProperty<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. |
Applies to
Σχόλια
https://aka.ms/ContentUserFeedback.
Σύντομα διαθέσιμα: Καθ' όλη τη διάρκεια του 2024 θα καταργήσουμε σταδιακά τα ζητήματα GitHub ως μηχανισμό ανάδρασης για το περιεχόμενο και θα το αντικαταστήσουμε με ένα νέο σύστημα ανάδρασης. Για περισσότερες πληροφορίες, ανατρέξτε στο θέμα:Υποβολή και προβολή σχολίων για