using Avalonia.Styling; namespace Avalonia.Controls { /// /// Decorator control that isolates controls subtree with locally defined . /// public class ThemeVariantScope : Decorator { /// /// Defines the property. /// public static readonly StyledProperty ActualThemeVariantProperty = AvaloniaProperty.Register( nameof(ActualThemeVariant), inherits: true, defaultValue: ThemeVariant.Light); /// /// Defines the property. /// public static readonly StyledProperty RequestedThemeVariantProperty = AvaloniaProperty.Register( nameof(RequestedThemeVariant), defaultValue: ThemeVariant.Default); /// /// Gets or sets the UI theme variant that is used by the control (and its child elements) for resource determination. /// The UI theme you specify with ThemeVariant can override the app-level ThemeVariant. /// /// /// Setting RequestedThemeVariant to will apply parent's actual theme variant on the current scope. /// public ThemeVariant? RequestedThemeVariant { get => GetValue(RequestedThemeVariantProperty); set => SetValue(RequestedThemeVariantProperty, value); } } }