RadComponentElement
Represents a visual element that integrates with the Visual Studio component model, providing design-time support and data binding capabilities for elements in the Telerik Presentation Framework.
RadComponentElement extends VisualElement with full component model integration, implementing IComponent and IBindableComponent to enable seamless integration with Visual Studio designers, property grids, and data binding systems.
This class provides the foundation for elements that need to participate in design-time operations such as property serialization, designer services, and component lifecycle management. It handles proper cleanup of designer resources and component registration during disposal.
RadComponentElement serves as the base class for RadItem and other interactive elements that require component model integration for advanced design-time scenarios and data binding support within the TPF architecture.
Definition
Namespace:Telerik.WinControls
Assembly:Telerik.WinControls.dll
Syntax:
[ComVisible(false)]
public class RadComponentElement : VisualElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IStylableNode, IBindableComponent, IComponent, IDisposable
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElement...
Derived Classes:
Implements:
Inherited Members
Constructors
public RadComponentElement()
Properties
Gets a value indicating whether the component can raise events.
protected virtual bool CanRaiseEvents { get; }
true if the component can raise events; otherwise, false.
The default implementation always returns true.
This property can be overridden in derived classes to control event raising behavior based on component state or other conditions.
Gets the container that contains the component.
[Browsable(false)]
public IContainer Container { get; }
The IContainer that contains the component, or null if the component is not sited.
This property provides access to the design-time container that manages this component's lifetime and provides services for component interaction and resource management.
Gets the collection of data-binding objects for this component.
public virtual ControlBindingsCollection DataBindings { get; }
A ControlBindingsCollection that contains the data-binding objects for this component.
Implements:
This collection manages all data binding relationships for the component, allowing properties to be bound to data sources. The collection is created on-demand and provides automatic synchronization between the component's properties and bound data sources.
Gets a value indicating whether the component is currently in design mode.
[Browsable(false)]
protected bool DesignMode { get; }
true if the component is in design mode; otherwise, false.
This property is used to determine if the component is being used in a design-time environment such as Visual Studio. It affects behavior for design-time scenarios versus runtime execution.
Gets or sets the site of the component.
[Browsable(false)]
public virtual ISite Site { get; set; }
The ISite associated with the component, or null if the component is not sited.
Implements:
Setting this property integrates the component with the design-time environment, enabling access to designer services and proper design mode state management. When set to null, the component is removed from design mode.
Methods
Releases the managed resources used by the RadComponentElement and optionally releases the unmanaged resources.
protected override void DisposeManagedResources()
Overrides:
This method handles proper cleanup of design-time resources including removal of the component from the designer host when running in design mode. It ensures proper component lifecycle management in Visual Studio designer scenarios.
Gets a service object of the specified type from the component's site.
protected virtual object GetService(Type service)
The type of service to retrieve.
Returns:An object that implements the requested service, or null if the service cannot be resolved.
This method provides access to design-time services when the component is sited in a designer. Common services include IDesignerHost, ITypeDescriptorContext, and other designer services.
Raises the PropertyChanged event and handles binding context updates.
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
A RadPropertyChangedEventArgs that contains the event data.
Overrides:
This override ensures that data binding context changes are properly propagated to all associated data bindings when the BindingContextProperty changes.
Returns a string representation of the RadComponentElement, including its site name if available.
public override string ToString()
A string containing the site name and type name if the element has a site; otherwise, just the type name.
Overrides: