New to Telerik UI for WinForms? Start a free 30-day trial

Represents a concrete implementation of RadElementTree that provides comprehensive theming and styling capabilities for Telerik controls, managing theme application and lifecycle within the element hierarchy.

ComponentThemableElementTree extends RadElementTree with complete theming system integration, enabling controls to automatically apply visual themes, respond to runtime theme changes, and participate in application-wide theming infrastructure.

As an IThemeChangeListener, it automatically responds to theme changes and integrates with ThemeResolutionService for theme resolution. Includes animation management with suspension/resume capabilities and sophisticated fallback mechanisms.

Features style versioning for efficient change tracking, application theme integration, and proper resource cleanup through IDisposable. Used by virtually all Telerik controls for consistent theming behavior.

Definition

Constructors

Initializes the tree for the specified component and subscribes it to theme-change notifications.

C#
public ComponentThemableElementTree(IComponentTreeHandler owner)
Parameters:ownerIComponentTreeHandler

The component tree handler whose element tree this instance manages.

Properties

Gets value indicating whether the animated property changes are suspended for the control. Also see SuspendAnimations().

C#
public bool AnimationsEnabled { get; }

Gets or sets whether theme resolution may use ApplicationThemeName instead of this tree's ThemeName. Changing the value clears the cached theme and reapplies the theme to the element tree.

C#
[Browsable(true)]
public bool EnableApplicationThemeName { get; set; }
C#
public bool EnableTheming { get; set; }

Gets or sets a value indicating whether to fallback to control default theme if the control does not support the current theme.

C#
[Browsable(false)]
public bool FallbackToControlDefault { get; set; }

Gets the currently used theme.

C#
public Theme Theme { get; }

Gets or sets the class name string that ThemeResolutionService will use to find the themes registered for the control.

C#
public virtual string ThemeClassName { get; set; }

By default the return value is RadControl's type FullName; Some controls like drop down menu has different ThemeClassName depending on the runtime usage of the control.

Gets or sets control's preffered theme name. Themes are stored and retrieved using APIs of ThemeResolutionService.

C#
[Browsable(true)]
public string ThemeName { get; set; }

If ThemeResolutionService.ApplicatonThemeName refers to a non-empty string, the theme of a RadControl can differ from the one set using RadControls.ThemeName property. If the themes differ, the RadControls.ThemeName property will be overridden by ThemeResolutionService.ApplicatonThemeName. If no theme is registered with a name as ThemeResolutionService.ApplicatonThemeName, then control will revert to the theme specified by its ThemeName property. If ThemeName is assigned to a non-existing theme name, the control may have no visual properties assigned, which will cause it look and behave in unexpected manner. If ThemeName equals empty string, control's theme is set to a theme that is registered within ThemeResolutionService with the name "ControlDefault".

Methods

Disposes the root element and unregisters this tree from theme-change notifications when disposing managed resources.

C#
protected override void Dispose(bool disposing)
Parameters:disposingbool

Whether to release managed resources; this override performs cleanup only when true.

Overrides: RadElementTree.Dispose(bool)

Resumes the animated property changes for the conrol. For more info see SuspendAnimations()

C#
public void ResumeAnimations()

Suspends the animated property changes for the control. When animation are suspended property changes still occur but without aniumations.

C#
public void SuspendAnimations()