• Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • NEW: Design Kits for Figma
    • Online Training
    • Document Processing Library
    • Embedded Reporting for web and desktop
    Web
    Kendo UI UI for jQuery UI for Angular UI for React UI for Vue UI for ASP.NET AJAX UI for ASP.NET MVC UI for ASP.NET Core UI for Blazor UI for Silverlight UI for PHP UI for JSP
    Mobile
    UI for .NET MAUI UI for Xamarin
    Document Management
    Telerik Document Processing
    Desktop
    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF UI for UWP
    Reporting & Mocking
    Telerik Reporting Telerik Report Server Telerik JustMock
    Automated Testing
    Test Studio Test Studio Dev Edition
    CMS
    Sitefinity
    UI/UX Design
    Unite UX
    Debugging
    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Jam FiddlerCap FiddlerCore
    Extended Reality
    UI for Unity XR
    Free Tools
    JustAssembly JustDecompile VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Docs & Support
  • Pricing
  • Search
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

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.

Inheritance
System.Object
DisposableObject
RadObject
GridLayoutElement
RadComponent
RadElement
RadService
Run
Run
Run
ThemeSource
AsyncReaderBase
AsyncReaderSource
ChartStyle
DiagramBehaviors
GanttViewDataItem
GridViewCellStyle
GridViewColumn
ListViewDetailColumn
RadListDataItem
UIChartElement
UISparkElement
VirtualGridViewInfo
AnimationEngine
GeneralTransform
CommandDescriptor
FilteringPopupViewModel
SyntaxEditorPalette
RadSyntaxEditorBehavior
Pen
LayoutElement
CommentUIProviderBase
DocumentElement
MailMergeDataSource
MentionProviderBase
Inherited Members
DisposableObject.GetBitState(Int64)
DisposableObject.SetBitState(Int64, Boolean)
DisposableObject.OnBitStateChanged(Int64, Boolean, Boolean)
DisposableObject.Dispose()
DisposableObject.Dispose(Boolean)
DisposableObject.PerformDispose(Boolean)
DisposableObject.DisposeUnmanagedResources()
DisposableObject.BitState
DisposableObject.Events
DisposableObject.IsDisposing
DisposableObject.IsDisposed
DisposableObject.Disposed
DisposableObject.Disposing
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Telerik.WinControls
Assembly: Telerik.WinControls.dll

Syntax

public class RadObject : DisposableObject, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor

Constructors

RadObject()

Declaration
public RadObject()

Fields

BindingContextProperty

Declaration
public static RadProperty BindingContextProperty
Field Value
RadProperty

RadType

Declaration
public static readonly RadObjectType RadType
Field Value
RadObjectType

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
DisposableObject.DisposeManagedResources()

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

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

Extension Methods

CommonExtensions.ClearIfNoBindingAndSet(RadObject, RadProperty)
DispatcherExtensions.CheckAccess(RadObject)
CommonExtensions.SetIfDifferent(RadObject, RadProperty, Object)
CommonExtensions.ClearIfSet(RadObject, RadProperty)
CommonExtensions.IsLocalValueSet(RadObject, RadProperty)
DispatcherExtensions.CheckAccess(RadObject)
DispatcherExtensions.CheckAccess(RadObject)
DispatcherExtensions.CheckAccess(RadObject)
SvgExtentions.Traverse<T>(T, Func<T, IEnumerable<T>>)
SvgExtentions.TraverseDepthFirst<T>(T, Func<T, IEnumerable<T>>)

Was this article helpful?

Tell us how we can improve this article

Skip
Getting Started
  • Install Now
  • Demos
  • Step-by-Step Tutorial
  • Sample Applications
  • SDK Samples
  • Visual Studio Extensions
Support Resources
  • Code Library
  • Knowledge Base
  • Videos
Community
  • Forums
  • Blogs
  • Feedback Portal
  • Document Processing Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.