Class
RadProperty

Represents a dependency property definition in the Telerik Presentation Framework, providing the foundation for the advanced property system that enables theming, styling, inheritance, and data binding throughout the framework.

Definition

Namespace:Telerik.WinControls

Assembly:Telerik.WinControls.dll

Syntax:

cs-api-definition
[TypeConverter(typeof(ExpandableObjectConverter))]
public class RadProperty

Inheritance: objectRadProperty

Fields

UnsetValue

Declaration

cs-api-definition
public static readonly object UnsetValue

Field Value

object

Properties

FullName

Declaration

cs-api-definition
public string FullName { get; }

Property Value

string

GlobalIndex

Declaration

cs-api-definition
public int GlobalIndex { get; }

Property Value

int

Name

Gets the name of this property.

Declaration

cs-api-definition
public string Name { get; }

Property Value

string

The string name that uniquely identifies this property within its owner type. This is the same name used when registering the property.

Remarks

Property names must be unique within their owner type hierarchy. The name is used for property lookup operations and debugging. Once a property is registered, its name cannot be changed.

OwnerType

Gets the type that owns this property definition.

Declaration

cs-api-definition
public Type OwnerType { get; }

Property Value

Type

The Type that originally registered this property. This is typically the type where the property was first defined, though the property may be inherited by derived types.

Remarks

The owner type is set when the property is registered through Register(string, Type, Type, RadPropertyMetadata) or RegisterAttached(string, Type, Type, RadPropertyMetadata). Derived types can add metadata through AddOwner(Type) but the original owner type remains unchanged.

PropertyType

Gets the type of values that can be stored in this property.

Declaration

cs-api-definition
public Type PropertyType { get; }

Property Value

Type

The Type that represents the data type of this property. All values assigned to this property must be compatible with this type.

Remarks

This is the type specified when the property was registered through Register(string, Type, Type, RadPropertyMetadata) or RegisterAttached(string, Type, Type, RadPropertyMetadata). The property system uses this type for validation and type checking during value assignment and retrieval operations.

PropertyTypeIsValueType

Declaration

cs-api-definition
public bool PropertyTypeIsValueType { get; }

Property Value

bool

ValidateValueCallback

Declaration

cs-api-definition
public ValidateValueCallback ValidateValueCallback { get; }

Property Value

ValidateValueCallback

Methods

AddOwner(Type)

Declaration

cs-api-definition
public RadProperty AddOwner(Type ownerType)

Parameters

ownerType

Type

Returns

RadProperty

AddOwner(Type, RadPropertyMetadata)

Declaration

cs-api-definition
public RadProperty AddOwner(Type ownerType, RadPropertyMetadata typeMetadata)

Parameters

ownerType

Type

typeMetadata

RadPropertyMetadata

Returns

RadProperty

Equals(object)

Declaration

cs-api-definition
public override bool Equals(object obj)

Parameters

obj

object

Returns

bool

Overrides object.Equals(object)

Find(Type, string)

Declaration

cs-api-definition
public static RadProperty Find(Type objectType, string propertyName)

Parameters

objectType

Type

propertyName

string

Returns

RadProperty

Find(string, string)

Declaration

cs-api-definition
public static RadProperty Find(string className, string propertyName)

Parameters

className

string

propertyName

string

Returns

RadProperty

FindClrProperty()

Declaration

cs-api-definition
public PropertyDescriptor FindClrProperty()

Returns

PropertyDescriptor

FindSafe(Type, string)

Declaration

cs-api-definition
public static RadProperty FindSafe(Type objectType, string propertyName)

Parameters

objectType

Type

propertyName

string

Returns

RadProperty

FindSafe(string, string)

Declaration

cs-api-definition
public static RadProperty FindSafe(string className, string propertyName)

Parameters

className

string

propertyName

string

Returns

RadProperty

GetHashCode()

Declaration

cs-api-definition
public override int GetHashCode()

Returns

int

Overrides object.GetHashCode()

GetMetadata(RadObject)

Declaration

cs-api-definition
public RadPropertyMetadata GetMetadata(RadObject radObject)

Parameters

radObject

RadObject

Returns

RadPropertyMetadata

GetMetadata(RadObjectType)

Declaration

cs-api-definition
public RadPropertyMetadata GetMetadata(RadObjectType radObjectType)

Parameters

radObjectType

RadObjectType

Returns

RadPropertyMetadata

IsValidType(object)

Determines whether the specified value is type-compatible with this property.

Declaration

cs-api-definition
public bool IsValidType(object value)

Parameters

value

object

The value to check for type compatibility.

Returns

bool

True if the value is type-compatible; otherwise, false.

Remarks

This method only checks type compatibility and does not invoke custom validation callbacks. Use IsValidValue for complete validation including custom validation logic.

IsValidValue(object, RadObject)

Determines whether the specified value is valid for this property on the given instance.

Declaration

cs-api-definition
public bool IsValidValue(object value, RadObject instance)

Parameters

value

object

The value to validate.

instance

RadObject

The RadObject instance where the value would be applied.

Returns

bool

True if the value is valid; otherwise, false.

Remarks

This method performs both type checking and custom validation. It first verifies that the value is compatible with the property type, then calls the ValidateValueCallback if one was specified during property registration.

OverrideMetadata(Type, RadPropertyMetadata)

Declaration

cs-api-definition
public void OverrideMetadata(Type forType, RadPropertyMetadata typeMetadata)

Parameters

forType

Type

typeMetadata

RadPropertyMetadata

Register(string, Type, Type, RadPropertyMetadata)

Registers a new dependency property with the specified metadata.

Declaration

cs-api-definition
public static RadProperty Register(string name, Type propertyType, Type ownerType, RadPropertyMetadata typeMetadata)

Parameters

name

string

The name of the property to register.

propertyType

Type

The type of the property value.

ownerType

Type

The type that owns this property.

typeMetadata

RadPropertyMetadata

Property metadata including default value, inheritance behavior, and callbacks.

Returns

RadProperty

A RadProperty identifier that can be used to set or get property values.

Remarks

This is the primary method for registering properties that belong to a specific type. The property can be accessed only through instances of the ownerType or its derived types. Use RegisterAttached(string, Type, Type, RadPropertyMetadata) for properties that can be applied to any RadObject.

Register(string, Type, Type, RadPropertyMetadata, ValidateValueCallback)

Registers a new dependency property with metadata and a validation callback.

Declaration

cs-api-definition
public static RadProperty Register(string name, Type propertyType, Type ownerType, RadPropertyMetadata typeMetadata, ValidateValueCallback validateValueCallback)

Parameters

name

string

The name of the property to register.

propertyType

Type

The type of the property value.

ownerType

Type

The type that owns this property.

typeMetadata

RadPropertyMetadata

Property metadata including default value, inheritance behavior, and callbacks.

validateValueCallback

ValidateValueCallback

A callback method to validate property values before they are set.

Returns

RadProperty

A RadProperty identifier that can be used to set or get property values.

Remarks

This overload provides validation capabilities, allowing you to verify property values before they are assigned. The validation callback is called for every value assignment and should return true for valid values, false for invalid ones.

RegisterAttached(string, Type, Type, RadPropertyMetadata)

Registers an attached property that can be applied to any RadObject instance.

Declaration

cs-api-definition
public static RadProperty RegisterAttached(string name, Type propertyType, Type ownerType, RadPropertyMetadata typeMetadata)

Parameters

name

string

The name of the attached property to register.

propertyType

Type

The type of the property value.

ownerType

Type

The type that defines this attached property.

typeMetadata

RadPropertyMetadata

Property metadata including default value and callbacks.

Returns

RadProperty

A RadProperty identifier for the attached property.

Remarks

Attached properties are a special kind of property that can be set on any RadObject, not just instances of the ownerType. This is useful for layout properties, styling hints, and other cross-cutting concerns that need to be applied broadly.

RegisterAttached(string, Type, Type, RadPropertyMetadata, ValidateValueCallback)

Registers an attached property with validation capabilities.

Declaration

cs-api-definition
public static RadProperty RegisterAttached(string name, Type propertyType, Type ownerType, RadPropertyMetadata typeMetadata, ValidateValueCallback validateValueCallback)

Parameters

name

string

The name of the attached property to register.

propertyType

Type

The type of the property value.

ownerType

Type

The type that defines this attached property.

typeMetadata

RadPropertyMetadata

Property metadata including default value and callbacks.

validateValueCallback

ValidateValueCallback

A callback method to validate property values before they are set.

Returns

RadProperty

A RadProperty identifier for the attached property.

Remarks

This overload combines attached property functionality with value validation, ensuring that only valid values can be assigned to the property regardless of which RadObject instance the property is applied to.