Table of Contents

Class AttachedProperties

Namespace
Icy.Data.Markup
Assembly
IcyUI.dll

Provides per-instance storage for attached property values, keyed by the owning object's lifetime.

public static class AttachedProperties
Inheritance
AttachedProperties
Inherited Members

Remarks

Static getter/setter accessors declared for an AttachedPropertyAttribute-marked type (e.g. Grid.GetRow/Grid.SetRow) should read and write through this store rather than maintaining their own storage, so values live and die with the target instance.

Methods

GetValue<T>(object, string, T)

Gets the attached value stored for target under key.

public static T GetValue<T>(object target, string key, T defaultValue = default)

Parameters

target object

The object the value is attached to.

key string

The name that identifies the attached property.

defaultValue T

The value returned when nothing has been stored yet.

Returns

T

The stored value, or defaultValue if none was set.

Type Parameters

T

The type of the stored value.

SetValue<T>(object, string, T)

Sets the attached value stored for target under key.

public static void SetValue<T>(object target, string key, T value)

Parameters

target object

The object the value is attached to.

key string

The name that identifies the attached property.

value T

The value to store.

Type Parameters

T

The type of the value to store.