Class 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.
Inherited Members
Namespace: Telerik.WinControls
Assembly: Telerik.WinControls.dll
Syntax
[ComVisible(false)]
public class RadComponentElement : VisualElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IStylableNode, IComponent, IDisposable, IBindableComponent
Remarks
RadComponentElement extends VisualElement with full component model integration, implementing System.ComponentModel.IComponent and System.Windows.Forms.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.
Constructors
RadComponentElement()
Declaration
public RadComponentElement()
Fields
ComponentElementLastStateKey
This constant is used internally for state key management.
Declaration
protected const long ComponentElementLastStateKey = 68719476736L
Field Value
System.Int64
|
Remarks
This constant defines the last state key used by ComponentElement, ensuring proper inheritance of state management in derived classes within the element hierarchy.
Properties
CanRaiseEvents
Gets a value indicating whether the component can raise events.
Declaration
protected virtual bool CanRaiseEvents { get; }
Property Value
System.Boolean
|
Remarks
This property can be overridden in derived classes to control event raising behavior based on component state or other conditions.
Container
Gets the container that contains the component.
Declaration
public IContainer Container { get; }
Property Value
System.ComponentModel.IContainer
The System.ComponentModel.IContainer that contains the component, or |
Remarks
This property provides access to the design-time container that manages this component's lifetime and provides services for component interaction and resource management.
DataBindings
Gets the collection of data-binding objects for this component.
Declaration
public virtual ControlBindingsCollection DataBindings { get; }
Property Value
System.Windows.Forms.ControlBindingsCollection
A System.Windows.Forms.ControlBindingsCollection that contains the data-binding objects for this component. |
Remarks
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.
DesignMode
Gets a value indicating whether the component is currently in design mode.
Declaration
protected bool DesignMode { get; }
Property Value
System.Boolean
|
Remarks
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.
IsDesignMode
Gets or sets a value indicating whether design mode is active.
Declaration
public override bool IsDesignMode { get; set; }
Property Value
System.Boolean
|
Overrides
Remarks
This property overrides the base implementation to integrate with the component site's design mode state. When a site is available, the site's design mode takes precedence over the base implementation's value.
Site
Gets or sets the site of the component.
Declaration
public virtual ISite Site { get; set; }
Property Value
System.ComponentModel.ISite
The System.ComponentModel.ISite associated with the component, or |
Remarks
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
DisposeManagedResources()
Releases the managed resources used by the RadComponentElement and optionally releases the unmanaged resources.
Declaration
protected override void DisposeManagedResources()
Overrides
Remarks
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.
GetService(Type)
Gets a service object of the specified type from the component's site.
Declaration
protected virtual object GetService(Type service)
Parameters
System.Type
service
The type of service to retrieve. |
Returns
System.Object
An object that implements the requested service, or null if the service cannot be resolved. |
Remarks
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.
OnPropertyChanged(RadPropertyChangedEventArgs)
Raises the PropertyChanged event and handles binding context updates.
Declaration
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Parameters
RadPropertyChangedEventArgs
e
A RadPropertyChangedEventArgs that contains the event data. |
Overrides
Remarks
This override ensures that data binding context changes are properly propagated to all associated data bindings when the BindingContextProperty changes.
ToString()
Returns a string representation of the RadComponentElement, including its site name if available.
Declaration
public override string ToString()
Returns
System.String
A string containing the site name and type name if the element has a site; otherwise, just the type name. |