ClassRadObject
Serves as the foundational base class for all objects in the Telerik Presentation Framework, implementing a sophisticated dependency property system inspired by WPF's property model. RadObject provides the core infrastructure for the TPF property system with multi-layered property values, automatic change notifications, and property inheritance. The system supports multiple value sources with precedence: Local Values (highest), Style Values, Inherited Values, and Default Values. Implements INotifyPropertyChanged with enhanced RadPropertyChanged events providing detailed change information. Through ICustomTypeDescriptor, it provides custom type information for designer support and property serialization. The property system includes comprehensive APIs (GetValue, SetValue, ResetValue, ClearValue) with priority-based resolution, validation callbacks, and efficient storage. Extends DisposableObject for proper resource cleanup and serves as the foundation for all TPF classes.
Definition
Namespace:Telerik.WinControls
Assembly:Telerik.WinControls.dll
Syntax:
public class RadObject : DisposableObject, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor
Inheritance: objectDisposableObjectRadObject
Derived Classes:
Implements:
Inherited Members
Constructors
RadObject()
Initializes a new instance of the RadObject class, setting up the property value collection and object type information.
Declaration
public RadObject()
Fields
BindingContextProperty
Declaration
public static RadProperty BindingContextProperty
Field Value
RadType
Declaration
public static readonly RadObjectType RadType
Field Value
Properties
BindingContext
Gets or sets the BindingContext for this object, which provides the foundation for data binding operations and can be inherited from parent objects.
Declaration
[Browsable(false)]
public virtual BindingContext BindingContext { get; set; }
Property Value
PropertyFilter
Gets or sets a Filter instance used to filter the property collection returned by GetProperties().
Declaration
[Browsable(false)]
public Filter PropertyFilter { get; set; }
Property Value
PropertyValues
Gets a collection containing property values.
Declaration
public RadPropertyValueCollection PropertyValues { get; }
Property Value
RadObjectType
Gets the RadObjectType associated with this object's system type, providing metadata and property registration information.
Declaration
[Browsable(false)]
public RadObjectType RadObjectType { get; }
Property Value
Methods
AddStylePropertySetting(IPropertySetting)
Registers a style setting for this instance.
Declaration
protected virtual ValueUpdateResult AddStylePropertySetting(IPropertySetting setting)
Parameters
setting
Returns
BindProperty(RadProperty, RadObject, RadProperty, PropertyBindingOptions)
Binds the specified property to a property of the provided binding source object.
Declaration
public ValueUpdateResult BindProperty(RadProperty propertyToBind, RadObject sourceObject, RadProperty sourceProperty, PropertyBindingOptions options)
Parameters
propertyToBind
Our property that is about to be bound.
sourceObject
The object to which source property belongs.
sourceProperty
The property to which we will bind.
options
Additional options, specifying the binding operation.
Returns
CanRaisePropertyChangeNotifications(RadPropertyValue)
Determines whether the object can raise PropertyChanging and PropertyChanged notifications. Current implementation checks whether the object is disposing or is already disposed of.
Declaration
protected virtual bool CanRaisePropertyChangeNotifications(RadPropertyValue propVal)
Parameters
propVal
Returns
ClearPropertyStore()
Removes all references to external property modifiers such as property bindings, style settings, and animations to prepare for disposal.
Declaration
protected virtual void ClearPropertyStore()
CoerceValue(RadPropertyValue, object)
Allows inheritors to force a coersion of the current calculated value for the given property.
Declaration
protected virtual object CoerceValue(RadPropertyValue propVal, object baseValue)
Parameters
propVal
The property value.
baseValue
The current caluclated value of the property.
Returns
Null if no coersion is needed.
DisposeManagedResources()
Releases managed resources by clearing the property store and disposing value animators to prevent memory leaks.
Declaration
protected override void DisposeManagedResources()
Overrides
GetDefaultValue(RadPropertyValue, object)
Allows inheritors to provide custom default value.
Declaration
protected virtual object GetDefaultValue(RadPropertyValue propVal, object baseDefaultValue)
Parameters
propVal
baseDefaultValue
Returns
GetInheritedValue(RadProperty)
Searches up in the chain of InheritanceParents for a value for the specified property.
Declaration
protected virtual object GetInheritedValue(RadProperty property)
Parameters
property
The property to examine.
Returns
GetPropertyValue(RadProperty)
Gets the RadPropertyValue structure that contains information about the specified property's effective value for this instance, including value source and composition details.
Declaration
public RadPropertyValue GetPropertyValue(RadProperty property)
Parameters
property
The RadProperty for which to retrieve the property value information.
Returns
The RadPropertyValue structure, or null if no effective value is recorded.
GetRegisteredRadProperty(string)
Gets the registered RadProperty with the specified name for this object's type, enabling dynamic property access by name.
Declaration
public RadProperty GetRegisteredRadProperty(string propertyName)
Parameters
propertyName
The name of the property to retrieve.
Returns
The RadProperty with the specified name, or null if no such property is registered.
GetValue(RadProperty)
Retrieves the current effective value for the specified RadProperty, resolving through the property value composition hierarchy.
Declaration
public virtual object GetValue(RadProperty property)
Parameters
property
The RadProperty for which to retrieve the current value.
Returns
The current effective value of the property, which may come from local, style, inherited, or default value sources.
GetValueSource(RadProperty)
Gets the ValueSource that currently provides the effective value for the specified property (Local, Style, Inherited, or Default).
Declaration
public ValueSource GetValueSource(RadProperty property)
Parameters
property
The RadProperty for which to determine the value source.
Returns
A ValueSource indicating which source is providing the current effective value.
IsPropertyCancelable(RadPropertyMetadata)
Determines whether the specified property may be canceled.
Declaration
protected virtual bool IsPropertyCancelable(RadPropertyMetadata metadata)
Parameters
metadata
The metadata associated with the property change.
Returns
OnNotifyPropertyChanged(PropertyChangedEventArgs)
Raises the standard .NET PropertyChanged event to notify subscribers of property value changes using the provided event arguments.
Declaration
protected virtual void OnNotifyPropertyChanged(PropertyChangedEventArgs e)
Parameters
e
The PropertyChangedEventArgs containing the property change information.
OnNotifyPropertyChanged(string)
Raises the standard .NET PropertyChanged event with the specified property name to notify subscribers of property value changes.
Declaration
protected virtual void OnNotifyPropertyChanged(string propertyName)
Parameters
propertyName
The name of the property that changed.
OnPropertyChanged(RadPropertyChangedEventArgs)
Raises the RadPropertyChanged event and the standard .NET PropertyChanged event to notify subscribers of property value changes.
Declaration
protected virtual void OnPropertyChanged(RadPropertyChangedEventArgs e)
Parameters
e
The RadPropertyChangedEventArgs containing information about the property change.
OnPropertyChanging(RadPropertyChangingEventArgs)
Raises the RadPropertyChanging event, allowing subscribers to be notified before a property value changes and potentially cancel the change.
Declaration
protected virtual void OnPropertyChanging(RadPropertyChangingEventArgs args)
Parameters
args
The RadPropertyChangingEventArgs containing information about the property change.
OnShouldSerializeProperty(ShouldSerializePropertyEventArgs)
Declaration
protected virtual void OnShouldSerializeProperty(ShouldSerializePropertyEventArgs args)
Parameters
args
ShouldSerializePropertyEventArgs
ReplaceDefaultDescriptors(PropertyDescriptorCollection)
Replaces the default property descriptors of object properties to perform RadObject-specific tasks like checking ShouldSerialize and RadProperty default values.
Declaration
protected virtual PropertyDescriptorCollection ReplaceDefaultDescriptors(PropertyDescriptorCollection props)
Parameters
props
The original PropertyDescriptorCollection to replace.
Returns
A new PropertyDescriptorCollection with custom RadObject-aware property descriptors.
ResetLocalValue(RadProperty)
Resets only the local value of the specified property while preserving other value sources like styles, inheritance, and default values.
Declaration
public virtual ValueUpdateResult ResetLocalValue(RadProperty property)
Parameters
property
The RadProperty for which to reset only the local value.
Returns
A ValueUpdateResult indicating the result of the operation.
ResetValue(RadProperty)
Resets the current value of the specified property by removing all effective value modifiers (local, style, animation) and reverting to the inherited or default value.
Declaration
public ValueUpdateResult ResetValue(RadProperty property)
Parameters
property
The RadProperty to reset to its default state.
Returns
A ValueUpdateResult indicating the result of the operation.
ResetValue(RadProperty, ValueResetFlags)
Resets the current value of the specified property using the provided flags.
Declaration
public ValueUpdateResult ResetValue(RadProperty property, ValueResetFlags flags)
Parameters
property
The RadProperty that should be reset.
flags
Additional flags that specify which effective modifiers should be reset.
Returns
The result of the operation.
ResetValueCore(RadPropertyValue, ValueResetFlags)
Resets the specified property value, using the provided reset flags.
Declaration
protected virtual ValueUpdateResult ResetValueCore(RadPropertyValue propVal, ValueResetFlags flags)
Parameters
propVal
flags
Returns
The result of the operation.
ResumePropertyNotifications()
Resumes property change notifications after a previous SuspendPropertyNotifications() call, restoring normal notification behavior when the suspension count reaches zero.
Declaration
public void ResumePropertyNotifications()
SetDefaultValueOverride(RadProperty, object)
Sets a default value override for the specified property, replacing the default value provided by the property's metadata with a custom value.
Declaration
public ValueUpdateResult SetDefaultValueOverride(RadProperty property, object value)
Parameters
property
The RadProperty for which to set the default value override.
value
The value to use as the new default, overriding the metadata-defined default value.
Returns
A ValueUpdateResult indicating the result of the operation.
SetValue(RadProperty, object)
Sets a local value for the specified RadProperty, establishing the highest priority value in the property value composition hierarchy.
Declaration
public ValueUpdateResult SetValue(RadProperty property, object value)
Parameters
property
The RadProperty for which to set the local value.
value
The value to set as the local value for the property.
Returns
A ValueUpdateResult indicating the result of the operation.
SetValueCore(RadPropertyValue, object, object, ValueSource)
Performs the core logic of updating property value.
Declaration
protected virtual ValueUpdateResult SetValueCore(RadPropertyValue propVal, object propModifier, object newValue, ValueSource source)
Parameters
propVal
The property value structure, holding property information.
propModifier
Additional modifier, like IPropertySetting
newValue
The actual new value to be set, valid for Local and DefaultValue sources.
source
Specifies the source of the provided new value.
Returns
The result of the operation.
ShouldSerializeProperty(RadProperty)
Determines whether the specified RadProperty should be serialized. Prevents theme and default values serialization.
Declaration
public virtual bool ShouldSerializeProperty(RadProperty property)
Parameters
property
The RadProperty that is about to be serialized.
Returns
A value indicating whether to serialize the property value.
SuspendPropertyNotifications()
Temporarily suspends property change notifications to improve performance during bulk property updates. Must be paired with ResumePropertyNotifications() to restore normal notification behavior.
Declaration
public void SuspendPropertyNotifications()
UnbindProperty(RadProperty)
Removes the property binding for the specified property, restoring the property to use local, style, inherited, or default values.
Declaration
public ValueUpdateResult UnbindProperty(RadProperty boundProperty)
Parameters
boundProperty
The RadProperty for which to remove the binding.
Returns
A ValueUpdateResult indicating the result of the operation.
UpdateValue(RadProperty)
Forces re-evaluation of the current value for the specified property, triggering value composition and change notifications if the value changes.
Declaration
public ValueUpdateResult UpdateValue(RadProperty property)
Parameters
property
The RadProperty for which to force value re-evaluation.
Returns
A ValueUpdateResult indicating the result of the operation.
UpdateValueCore(RadPropertyValue)
Performs the core value update logic.
Declaration
protected virtual ValueUpdateResult UpdateValueCore(RadPropertyValue propVal)
Parameters
propVal
Returns
The result of the operation.
Events
PropertyChanged
Occurs when a property value changes, providing standard .NET property change notification. For RadProperty changes, the system automatically raises this event. For non-RadProperty changes, developers must manually fire this event using the INotifyPropertyChanged API.
Declaration
[Browsable(false)]
public event PropertyChangedEventHandler PropertyChanged
Event Value
Implements
RadPropertyChanged
Occurs when a RadProperty value changes, providing enhanced property change information including old and new values, metadata, and value source details specific to the Telerik property system.
Declaration
[Browsable(false)]
public event RadPropertyChangedEventHandler RadPropertyChanged
Event Value
RadPropertyChanging
Occurs before a RadProperty value changes, allowing cancellation of the property change operation and providing access to the proposed new value before it is applied.
Declaration
[Browsable(false)]
public event RadPropertyChangingEventHandler RadPropertyChanging
Event Value