Provides centralized theme management and resolution services for RadControls applications.
Definition
Namespace:Telerik.WinControls
Assembly:Telerik.WinControls.dll
Syntax:
public class ThemeResolutionService
Inheritance: objectThemeResolutionService
Constructors
public ThemeResolutionService()
Fields
public static string TelerikFluentIconsFontName
public static string TelerikWebUIFontName
public static string WebComponentsIconsFontName
Properties
Determines whether animations are allowed across entire application.
public static bool AllowAnimations { get; set; }
Gets or sets value indicating the theme name that will be used by all controls in the application.
public static string ApplicationThemeName { get; set; }
If the value of this property is null or empty each control will be assigned a theme, corresponding on the ThemeName property of the control. Otherwise the ThemeName property will be disregarded. If a specific control in the application has no theme registered with the name specified by ApplicationThemeName, it will be assigned its ControlDefault theme name.
"ControlDefault" theme name
public static string ControlDefaultThemeName { get; set; }
public static string SystemThemeName { get; }
Methods
Clears all stylesheets registered previously with the themeName specified.
Gets a list of all registered themes.
Gets any themes registered for a specific control by control type name or control name.
public static List<Theme> GetAvailableThemes(IComponentTreeHandler control)
List<Theme>
Returns a previously loaded font by given font name.
public static FontFamily GetCustomFont(string fontName)
The name of font.
Returns:The FontFamily or null if font with given name is not loaded.
Returns a font by given font name. The font can be custom(loaded in memory) or installed on the machine.
public static StyleGroup GetStyleSheetBuilder(IComponentTreeHandler control, string elementTypeFullName, string elementName, string proposedThemeName)
public static StyleGroup GetStyleSheetBuilder(RadElement element, string proposedThemeName)
public static StyleGroup GetStyleSheetBuilder(RadElement element)
Gets all StyleSheets registered under a theme name.
public static StyleGroup[] GetStyleSheetBuilders(string themeName)
Loads a theme package stored in the provided embedded resource.
public static bool LoadPackageResource(ThemeResolutionService.ResourceParams resourceParams, bool throwOnError)
True to throw an exception if it occurs, false otherwise.
Returns:Registers a StyleBuilder for specific type of controls and specific type of elements under the name given.
public static void RegisterControlStyleBuilder(string controlTypeName, string elementTypeName, StyleGroup builder, string themeName)
Registers a theme as dark, by its theme name.
public static void RegisterDarkTheme(string themeName)
The name of the theme.
public static void RegisterElementTypeDefaultStyleBuilder(string themeName, string elementTypeName, StyleGroup builder)
Registers a StyleSheet found in styleBuilderRegistration using also the registration details specified under the theme name specified.
public static void RegisterStyleBuilder(StyleGroup styleBuilderRegistration, string themeName)
public static void RegisterStyleBuilderByControlName(string controlName, string elementTypeName, StyleGroup builder, string themeName)
Registers theme from a file or resource that contains a XML-serialized Theme object. The Visual Style Builder application for example is capable of designing and serializing themes. Theme files generally contain Theme with one or several style sheets each assigned a registration that defines which RadControl and/or RadElment the style sheet applies.
public static void RegisterThemeFromStorage(ThemeStorageType storageType, Assembly assembly, string themeLocation)
Registers theme from a file or resource that contains a XML-serialized Theme object. The Visual Style Builder application for example is capable of designing and serializing themes. Theme files generally contain Theme with one or several style sheets each assigned a registration that defines which RadControl and/or RadElment the style sheet applies.
public static void RegisterThemeFromStorage(ThemeStorageType storageType, ThemeResolutionService.ResourceParams resourceParams)
Registers theme from a file or resource that contains a XML-serialized Theme object. The Visual Style Builder application for example is capable of designing and serializing themes. Theme files generally contain Theme with one or several style sheets each assigned a registration that defines which RadControl and/or RadElment the style sheet applies.
public static void RegisterThemeFromStorage(ThemeStorageType storageType, string themeLocation)
public static void RegisterThemeRepository(XmlStyleRepository styleRepository, string themeName)
Resumes the ThemeChange event. This method is used internally.
public static void ResumeThemeChange()
Resumes the ThemeChange event. This method is used internally.
public static void ResumeThemeChange(bool raiseChanged)
Determines whether to fire the ThemeChanged event.
Call to subscribe for theme change event, for the specified control theme class name. Note the event may be fired from another thread
public static void SubscribeForThemeChanged(IThemeChangeListener listener)
Suspends the ThemeChange event. This method is used internally.
public static void SuspendThemeChange()
Removes an instance of the StyleGroup class from the dictionaries with registered style builders.
public static void UnregisterStyleSheetBuilder(StyleGroup builder)
The instance to remove.
Call to unsubscribe for theme change event.
public static void UnsubscribeFromThemeChanged(IThemeChangeListener listener)
Events
public static event ThemeChangedHandler ApplicationThemeChanged
public static event ResolveStyleBuilderEventHandler ResolveStyleBuilder