Class
ThemeSource

ThemeSource is used to load user-defined themes for RadControls in an application. Themes load immediately when correct property values specified and last for the life time of the application. After a theme is loaded it can be used by the corresponding types of controls placed on any Form of the application. ThemeSource object are generally used by ThemeManager component placed on a Form

Definition

Namespace:Telerik.WinControls

Assembly:Telerik.WinControls.dll

Syntax:

cs-api-definition
public class ThemeSource : RadObject, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor

Inheritance: objectDisposableObjectRadObjectThemeSource

Implements: ICustomTypeDescriptorIDisposableINotifyPropertyChanged

Inherited Members RadObject.BindingContextPropertyRadObject.RadTypeRadObject.ReplaceDefaultDescriptors(PropertyDescriptorCollection)RadObject.ClearPropertyStore()RadObject.SuspendPropertyNotifications()RadObject.ResumePropertyNotifications()RadObject.GetPropertyValue(RadProperty)RadObject.SetDefaultValueOverride(RadProperty, object)RadObject.GetValue(RadProperty)RadObject.SetValue(RadProperty, object)RadObject.ResetValue(RadProperty)RadObject.ResetLocalValue(RadProperty)RadObject.ResetValue(RadProperty, ValueResetFlags)RadObject.UpdateValue(RadProperty)RadObject.GetValueSource(RadProperty)RadObject.GetRegisteredRadProperty(string)RadObject.UpdateValueCore(RadPropertyValue)RadObject.SetValueCore(RadPropertyValue, object, object, ValueSource)RadObject.ResetValueCore(RadPropertyValue, ValueResetFlags)RadObject.GetDefaultValue(RadPropertyValue, object)RadObject.CoerceValue(RadPropertyValue, object)RadObject.ShouldSerializeProperty(RadProperty)RadObject.CanRaisePropertyChangeNotifications(RadPropertyValue)RadObject.BindProperty(RadProperty, RadObject, RadProperty, PropertyBindingOptions)RadObject.UnbindProperty(RadProperty)RadObject.AddStylePropertySetting(IPropertySetting)RadObject.GetInheritedValue(RadProperty)RadObject.OnPropertyChanging(RadPropertyChangingEventArgs)RadObject.OnPropertyChanged(RadPropertyChangedEventArgs)RadObject.OnNotifyPropertyChanged(string)RadObject.OnNotifyPropertyChanged(PropertyChangedEventArgs)RadObject.OnShouldSerializeProperty(ShouldSerializePropertyEventArgs)RadObject.IsPropertyCancelable(RadPropertyMetadata)RadObject.PropertyValuesRadObject.PropertyFilterRadObject.RadObjectTypeRadObject.BindingContextRadObject.PropertyChangedRadObject.RadPropertyChangedRadObject.RadPropertyChangingDisposableObject.GetBitState(long)DisposableObject.SetBitState(long, bool)DisposableObject.OnBitStateChanged(long, bool, bool)DisposableObject.Dispose()DisposableObject.Dispose(bool)DisposableObject.PerformDispose(bool)DisposableObject.DisposeUnmanagedResources()DisposableObject.BitStateDisposableObject.EventsDisposableObject.IsDisposingDisposableObject.IsDisposedDisposableObject.DisposedDisposableObject.Disposing

Constructors

ThemeSource()

Declaration

cs-api-definition
public ThemeSource()

Fields

StorageTypeProperty

Declaration

cs-api-definition
public static RadProperty StorageTypeProperty

Field Value

RadProperty

ThemeLocationProperty

Declaration

cs-api-definition
public static RadProperty ThemeLocationProperty

Field Value

RadProperty

Properties

CallingAssembly

Declaration

cs-api-definition
[Browsable(false)]
public Assembly CallingAssembly { get; set; }

Property Value

Assembly

OwnerThemeManager

Gets or sets the owner theme manager component. Generally used by Form's designer.

Declaration

cs-api-definition
public RadThemeManager OwnerThemeManager { get; set; }

Property Value

RadThemeManager

SettingsAreValid

Gets a value indicating whether property values are valid

Declaration

cs-api-definition
public bool SettingsAreValid { get; }

Property Value

bool

StorageType

Gets or sets File or Resource type of storage for the theme file

Declaration

cs-api-definition
public ThemeStorageType StorageType { get; set; }

Property Value

ThemeStorageType

ThemeLoadingError

Gets value indicating the error message if Theme was not loaded successfully.

Declaration

cs-api-definition
public string ThemeLoadingError { get; }

Property Value

string

ThemeLocation

Gets or sets the full resource name if StorageType is Resource. Example: "MyNamespace.MyThemeFileName.xml". If the StorageType specified is File, then the value of this property should represent the full or relative file path, accessible by the application. The "" sign can be used to substitute the application executable path. Eg. "C:\MyApp\MyThemeFileName.xml" or "....\MyThemeFileName.xml" or "\MyThemeFileName.xml"

Declaration

cs-api-definition
public string ThemeLocation { get; set; }

Property Value

string

ThemeStorageValid

Indicates whether the specified theme was loaded successfully.

Declaration

cs-api-definition
public bool ThemeStorageValid { get; }

Property Value

bool

Methods

DisposeManagedResources()

Releases managed resources by clearing the property store and disposing value animators to prevent memory leaks.

Declaration

cs-api-definition
protected override void DisposeManagedResources()

Overrides RadObject.DisposeManagedResources()

ReloadThemeFromStorage()

Loads the theme from the file resource specified and registers it into ThemeResolutionService. Thais method is called immediately when correct ThemeLocation and StorageType are specified.

Declaration

cs-api-definition
public virtual void ReloadThemeFromStorage()