ModernTheme Class
Includes all of the resources for Actipro's Modern theme.
public class ModernTheme : Styles, IAvaloniaList<IStyle>, IAvaloniaReadOnlyList<IStyle>, IStyle, IResourceProvider, IResourceNode
- Inheritance:
- object AvaloniaObject Styles object
- Implements:
- IAvaloniaList<IStyle> IAvaloniaReadOnlyList<IStyle> IStyle IResourceProvider IResourceNode
Constructors
ModernTheme(IServiceProvider?)
Initializes an instance of the class.
public ModernTheme(IServiceProvider? serviceProvider = null)
Parameter | Type | Description |
---|---|---|
serviceProvider | IServiceProvider | The parent's service provider. |
Properties
AreNativeControlThemesEnabled
Whether control themes for native controls should be enabled.
public bool AreNativeControlThemesEnabled { get; set; }
Property Value
- bool:
The default value is
true
.
Definition
A ThemeDefinition that contains options for generating theme resources.
public ThemeDefinition? Definition { get; set; }
Property Value
Remarks
Theme resources are automatically refreshed when this property is set. If properties on the current ThemeDefinition instance are changed but this Definition property is not set, the RefreshResources() method should be invoked to manually refresh the theme resources.
Includes
A ThemeStyleIncludes that specifies the styles to include from various additional Actipro assemblies that are used within the application.
public ThemeStyleIncludes Includes { get; set; }
Property Value
- ThemeStyleIncludes:
The default value is None.
Methods
RefreshResources()
Refreshes the active theme resources by running the theme generator again.
public void RefreshResources()
Remarks
This method should be called after properties are changed on the ThemeDefinition instance in the Definition property. This method does not need to be called if a completely different ThemeDefinition instance will be swapped into the Definition property, since a refresh automatically occurs in that scenario.
TryGetCurrent(out ModernTheme?)
Tries to locate the ModernTheme instance within the Avalonia.Application.Styles collection.
public static bool TryGetCurrent(out ModernTheme? modernTheme)
Parameter | Type | Description |
---|---|---|
modernTheme | ModernTheme | Returns the ModernTheme instance that was found, if any. |
Returns
- bool:
true
if a ModernTheme instance was found; otherwise,false
.
Fields
AreNativeControlThemesEnabledProperty
Defines the AreNativeControlThemesEnabled property.
public static readonly StyledProperty<bool> AreNativeControlThemesEnabledProperty
DefinitionProperty
Defines the Definition property.
public static readonly StyledProperty<ThemeDefinition?> DefinitionProperty
IncludesProperty
Defines the Includes property.
public static readonly StyledProperty<ThemeStyleIncludes> IncludesProperty
Inherited Members
- Styles.TryGetResource(object, ThemeVariant, out object)
- Styles.AddRange(IEnumerable<IStyle>)
- Styles.InsertRange(int, IEnumerable<IStyle>)
- Styles.Move(int, int)
- Styles.MoveRange(int, int, int)
- Styles.RemoveAll(IEnumerable<IStyle>)
- Styles.RemoveRange(int, int)
- Styles.IndexOf(IStyle)
- Styles.Insert(int, IStyle)
- Styles.RemoveAt(int)
- Styles.Add(IStyle)
- Styles.Clear()
- Styles.Contains(IStyle)
- Styles.CopyTo(IStyle[], int)
- Styles.Remove(IStyle)
- Styles.GetEnumerator()
- Styles.Count
- Styles.Owner
- Styles.Resources
- Styles.this[int]
- Styles.CollectionChanged
- Styles.OwnerChanged
- AvaloniaObject.CheckAccess()
- AvaloniaObject.VerifyAccess()
- AvaloniaObject.ClearValue(AvaloniaProperty)
- AvaloniaObject.ClearValue<T>(AvaloniaProperty<T>)
- AvaloniaObject.ClearValue<T>(StyledProperty<T>)
- AvaloniaObject.ClearValue<T>(DirectPropertyBase<T>)
- AvaloniaObject.Equals(object)
- AvaloniaObject.GetHashCode()
- AvaloniaObject.GetValue(AvaloniaProperty)
- AvaloniaObject.GetValue<T>(StyledProperty<T>)
- AvaloniaObject.GetValue<T>(DirectPropertyBase<T>)
- AvaloniaObject.GetBaseValue<T>(StyledProperty<T>)
- AvaloniaObject.IsAnimating(AvaloniaProperty)
- AvaloniaObject.IsSet(AvaloniaProperty)
- AvaloniaObject.SetValue(AvaloniaProperty, object, BindingPriority)
- AvaloniaObject.SetValue<T>(StyledProperty<T>, T, BindingPriority)
- AvaloniaObject.SetValue<T>(DirectPropertyBase<T>, T)
- AvaloniaObject.SetCurrentValue(AvaloniaProperty, object)
- AvaloniaObject.SetCurrentValue<T>(StyledProperty<T>, T)
- AvaloniaObject.Bind(AvaloniaProperty, IObservable<object>, BindingPriority)
- AvaloniaObject.Bind<T>(StyledProperty<T>, IObservable<object>, BindingPriority)
- AvaloniaObject.Bind<T>(StyledProperty<T>, IObservable<T>, BindingPriority)
- AvaloniaObject.Bind<T>(StyledProperty<T>, IObservable<BindingValue<T>>, BindingPriority)
- AvaloniaObject.Bind<T>(DirectPropertyBase<T>, IObservable<object>)
- AvaloniaObject.Bind<T>(DirectPropertyBase<T>, IObservable<T>)
- AvaloniaObject.Bind<T>(DirectPropertyBase<T>, IObservable<BindingValue<T>>)
- AvaloniaObject.CoerceValue(AvaloniaProperty)
- AvaloniaObject.UpdateDataValidation(AvaloniaProperty, BindingValueType, Exception)
- AvaloniaObject.OnPropertyChangedCore(AvaloniaPropertyChangedEventArgs)
- AvaloniaObject.OnPropertyChanged(AvaloniaPropertyChangedEventArgs)
- AvaloniaObject.RaisePropertyChanged<T>(DirectPropertyBase<T>, T, T)
- AvaloniaObject.SetAndRaise<T>(DirectPropertyBase<T>, ref T, T)
- AvaloniaObject.InheritanceParent
- AvaloniaObject.this[AvaloniaProperty]
- AvaloniaObject.this[IndexerDescriptor]
- AvaloniaObject.PropertyChanged
- object.GetType()
- object.MemberwiseClone()
- object.ToString()
- object.Equals(object, object)
- object.ReferenceEquals(object, object)
Extension Methods
- AvaloniaObjectExtensions.BindToProperty(AvaloniaObject, AvaloniaProperty, AvaloniaObject, AvaloniaProperty, BindingMode)
- AvaloniaObjectExtensions.BindToProperty(AvaloniaObject, AvaloniaProperty, object, AvaloniaProperty, BindingMode, IValueConverter, object)
- ObjectExtensions.TryConvertToDouble(object, out double)
- ObjectExtensions.TryConvertToDouble(object, IFormatProvider, out double)