Class RadObject
Base for all TPF classes. Implements WPF-like property system with different value sources. Provides public interface for getting, setting value or re-setting property value.
Inherited Members
Namespace: Telerik.WinControls
Assembly: Telerik.WinControls.dll
Syntax
public class RadObject : DisposableObject, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor
Constructors
RadObject()
Declaration
public RadObject()
Fields
BindingContextProperty
RadType
Properties
BindingContext
Gets or sets the BindingContext for the object.
Declaration
[RadPropertyDefaultValue("BindingContext", typeof(RadObject))]
public virtual BindingContext BindingContext { get; set; }
Property Value
System.Windows.Forms.BindingContext
|
IsDesignMode
Determines whether the element is in design mode.
Declaration
public virtual bool IsDesignMode { get; set; }
Property Value
System.Boolean
|
PropertyFilter
Gets or sets a Filter instance, used to filter the ICustomPropertyDescriptor.GetProperties collection.
Declaration
public Filter PropertyFilter { get; set; }
Property Value
Filter
|
PropertyValues
Gets a collection containing property values.
Declaration
public RadPropertyValueCollection PropertyValues { get; }
Property Value
RadPropertyValueCollection
|
RadObjectType
Gets the RadObjectType which is associated with this system type.
Declaration
public RadObjectType RadObjectType { get; }
Property Value
RadObjectType
|
Methods
AddStylePropertySetting(IPropertySetting)
Registers a style setting for this instance.
Declaration
protected virtual ValueUpdateResult AddStylePropertySetting(IPropertySetting setting)
Parameters
IPropertySetting
setting
|
Returns
ValueUpdateResult
|
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
RadProperty
propertyToBind
Our property that is about to be bound. |
RadObject
sourceObject
The object to which source property belongs. |
RadProperty
sourceProperty
The property to which we will bind. |
PropertyBindingOptions
options
Additional options, specifying the binding operation. |
Returns
ValueUpdateResult
|
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
RadPropertyValue
propVal
|
Returns
System.Boolean
|
ClearPropertyStore()
Removes all references to external property modifiers such as property bindings, style settings and animations.
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
RadPropertyValue
propVal
The property value. |
System.Object
baseValue
The current caluclated value of the property. |
Returns
System.Object
Null if no coersion is needed. |
DisposeManagedResources()
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
RadPropertyValue
propVal
|
System.Object
baseDefaultValue
|
Returns
System.Object
|
GetInheritedValue(RadProperty)
Searches up in the chain of InheritanceParents for a value for the specified property.
Declaration
protected virtual object GetInheritedValue(RadProperty property)
Parameters
RadProperty
property
The property to examine. |
Returns
System.Object
|
GetPropertyValue(RadProperty)
Gets the RadPropertyValue structure that holds information about the specified property's effective value for this instance. May be null if no effective value is recorded.
Declaration
public RadPropertyValue GetPropertyValue(RadProperty property)
Parameters
RadProperty
property
|
Returns
RadPropertyValue
|
GetRegisteredRadProperty(String)
Gets the registered property with the specified name.
Declaration
public RadProperty GetRegisteredRadProperty(string propertyName)
Parameters
System.String
propertyName
|
Returns
RadProperty
|
GetValue(RadProperty)
Retrieves the current value for the specified property.
Declaration
public virtual object GetValue(RadProperty property)
Parameters
RadProperty
property
|
Returns
System.Object
|
GetValueSource(RadProperty)
Gets the source of the current value for the specified property.
Declaration
public ValueSource GetValueSource(RadProperty property)
Parameters
RadProperty
property
|
Returns
ValueSource
|
IsPropertyCancelable(RadPropertyMetadata)
Determines whether the specified property may be canceled.
Declaration
protected virtual bool IsPropertyCancelable(RadPropertyMetadata metadata)
Parameters
RadPropertyMetadata
metadata
The metadata associated with the property change. |
Returns
System.Boolean
|
OnNotifyPropertyChanged(PropertyChangedEventArgs)
Raises the standard .NET PropertyChanged event.
Declaration
protected virtual void OnNotifyPropertyChanged(PropertyChangedEventArgs e)
Parameters
System.ComponentModel.PropertyChangedEventArgs
e
|
OnNotifyPropertyChanged(String)
Raises the PropertyChanged event.
Declaration
protected virtual void OnNotifyPropertyChanged(string propertyName)
Parameters
System.String
propertyName
The name of the property. |
OnPropertyChanged(RadPropertyChangedEventArgs)
Raises the PropertyChanged event.
Declaration
protected virtual void OnPropertyChanged(RadPropertyChangedEventArgs e)
Parameters
RadPropertyChangedEventArgs
e
|
OnPropertyChanging(RadPropertyChangingEventArgs)
Raises the RadPropertyChanging event.
Declaration
protected virtual void OnPropertyChanging(RadPropertyChangingEventArgs args)
Parameters
RadPropertyChangingEventArgs
args
|
OnShouldSerializeProperty(ShouldSerializePropertyEventArgs)
Declaration
protected virtual void OnShouldSerializeProperty(ShouldSerializePropertyEventArgs args)
Parameters
ShouldSerializePropertyEventArgs
args
|
RemoveStylePropertySetting(IPropertySetting)
Called when element style condition changes. This method is used internally.
Declaration
public virtual void RemoveStylePropertySetting(IPropertySetting setting)
Parameters
IPropertySetting
setting
|
RemoveStylePropertySetting(RadProperty)
Called when element style condition changes. This method is used internally.
Declaration
public void RemoveStylePropertySetting(RadProperty property)
Parameters
RadProperty
property
|
ReplaceDefaultDescriptors(PropertyDescriptorCollection)
Replaces the default property descriptors of properties of the object in order to perform Rad-Object specific tasks like checking ShouldSerialize and RadProperty-DefaultValue...
Declaration
protected virtual PropertyDescriptorCollection ReplaceDefaultDescriptors(PropertyDescriptorCollection props)
Parameters
System.ComponentModel.PropertyDescriptorCollection
props
|
Returns
System.ComponentModel.PropertyDescriptorCollection
|
ResetLocalValue(RadProperty)
Reset the local value of the property.
Declaration
public virtual ValueUpdateResult ResetLocalValue(RadProperty property)
Parameters
RadProperty
property
The RadProperty to be reset. |
Returns
ValueUpdateResult
|
ResetValue(RadProperty)
Resets the current value of the specified property. This method will remove any effective value modifier (such as style or animation setting) for the specified property.
Declaration
public ValueUpdateResult ResetValue(RadProperty property)
Parameters
RadProperty
property
The RadProperty that should be reset. |
Returns
ValueUpdateResult
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
RadProperty
property
The RadProperty that should be reset. |
ValueResetFlags
flags
Additional flags that specify which effective modifiers should be reset. |
Returns
ValueUpdateResult
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
RadPropertyValue
propVal
|
ValueResetFlags
flags
|
Returns
ValueUpdateResult
The result of the operation. |
ResumePropertyNotifications()
Resumes property notifications after a previous SuspendPropertyNotifications() call.
Declaration
public void ResumePropertyNotifications()
SetDefaultValueOverride(RadProperty, Object)
Applies the provided value as an override of the Default value provided by the specified property's metadata.
Declaration
public ValueUpdateResult SetDefaultValueOverride(RadProperty property, object value)
Parameters
RadProperty
property
|
System.Object
value
|
Returns
ValueUpdateResult
|
SetValue(RadProperty, Object)
Applies the provided value as Local for the specified property.
Declaration
public ValueUpdateResult SetValue(RadProperty property, object value)
Parameters
RadProperty
property
|
System.Object
value
|
Returns
ValueUpdateResult
The result of the operation. |
SetValueAtDesignTime(RadProperty, Object)
Applies the specified value as Local for the desired property and raises the flag IsLocalValueSetAtDesignTime for that property. All design-time direct property modifications (e.g. item.Text = "Item1") should be done through this method for the property to be properly serialized. If a property is modified through a property grid, the custom property descriptor will automatically apply this logic. This method is used internally.
Declaration
public void SetValueAtDesignTime(RadProperty property, object value)
Parameters
RadProperty
property
|
System.Object
value
|
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
RadPropertyValue
propVal
The property value structure, holding property information. |
System.Object
propModifier
Additional modifier, like IPropertySetting |
System.Object
newValue
The actual new value to be set, valid for Local and DefaultValue sources. |
ValueSource
source
Specifies the source of the provided new value. |
Returns
ValueUpdateResult
The result of the operation. |
ShouldSerializeProperty(PropertyDescriptor)
Determines whether the property defined by the provided property descriptor should be serialized.
Declaration
public virtual bool? ShouldSerializeProperty(PropertyDescriptor property)
Parameters
System.ComponentModel.PropertyDescriptor
property
|
Returns
System.Nullable<System.Boolean>
|
ShouldSerializeProperty(RadProperty)
Determines whether the specified RadProperty should be serialized. Prevents theme and default values serialization.
Declaration
public virtual bool ShouldSerializeProperty(RadProperty property)
Parameters
RadProperty
property
The RadProperty that is about to be serialized. |
Returns
System.Boolean
A value indicating whether to serialize the property value. |
SuspendPropertyNotifications()
Allows PropertyChanging and PropertyChanged notifications to be temporary suspended.
Declaration
public void SuspendPropertyNotifications()
UnbindProperty(RadProperty)
Removes the binding for the specified property.
Declaration
public ValueUpdateResult UnbindProperty(RadProperty boundProperty)
Parameters
RadProperty
boundProperty
|
Returns
ValueUpdateResult
The result of the operation. |
UpdateValue(RadProperty)
Forces re-evaluation of the current value for the specified property.
Declaration
public ValueUpdateResult UpdateValue(RadProperty property)
Parameters
RadProperty
property
|
Returns
ValueUpdateResult
The result of the operation. |
UpdateValueCore(RadPropertyValue)
Performs the core value update logic.
Declaration
protected virtual ValueUpdateResult UpdateValueCore(RadPropertyValue propVal)
Parameters
RadPropertyValue
propVal
|
Returns
ValueUpdateResult
The result of the operation. |
Events
PropertyChanged
Occurs when a property of an object changes. Note: if a property which is not a RadProperty changes, the developer is responsible for firing this event by using the System.ComponentModel.INotifyPropertyChanged API.
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
System.ComponentModel.PropertyChangedEventHandler
|
RadPropertyChanged
Occurs when a property of a RadObject changes.
Declaration
public event RadPropertyChangedEventHandler RadPropertyChanged
Event Type
RadPropertyChangedEventHandler
|
RadPropertyChanging
Occurs prior to property of a RadObject changes.
Declaration
public event RadPropertyChangingEventHandler RadPropertyChanging
Event Type
RadPropertyChangingEventHandler
|
ShouldSerializePropertyHandler
Occurs when a property is about to be serialized at design time. Suitable to prevent a default value of being serialized in the parent hierarchy of a RadObject instance.
Declaration
public event ShouldSerializePropertyEventHandler ShouldSerializePropertyHandler
Event Type
ShouldSerializePropertyEventHandler
|