Skip to main content
Flowery.Uno includes 35+ pre-built DaisyUI themes with full support for runtime theme switching, persistence, and customization.

Quick Start

Switch Themes in Code

using Flowery.Controls;

// One-liner to switch themes
DaisyThemeManager.ApplyTheme("Synthwave");

Switch Themes in XAML

xmlns:daisy="using:Flowery.Controls"

<!-- Drop-in theme switcher - no code-behind needed -->
<daisy:DaisyThemeDropdown MinWidth="220" />

<!-- Or a simple toggle -->
<daisy:DaisyThemeController Mode="Swap" />

Available Themes

Flowery.Uno includes all 36 official DaisyUI themes:
  • Light
  • Acid
  • Autumn
  • Bumblebee
  • Caramellatte
  • Cmyk
  • Corporate
  • Cupcake
  • Cyberpunk
  • Emerald
  • Fantasy
  • Garden
  • Lemonade
  • Lofi
  • Nord
  • Pastel
  • Retro
  • Silk
  • Valentine
  • Winter
  • Wireframe

DaisyThemeManager API

The centralized static class for theme management.

Core Methods

using Flowery.Controls;

// Apply a theme
DaisyThemeManager.ApplyTheme("Synthwave");

// Get current theme
var current = DaisyThemeManager.CurrentThemeName;

// List all themes
foreach (var theme in DaisyThemeManager.AvailableThemes)
    Console.WriteLine($"{theme.Name} (Dark: {theme.IsDark})");

// Listen for changes
DaisyThemeManager.ThemeChanged += (sender, themeName) =>
    Console.WriteLine($"Theme changed to: {themeName}");

// Check if dark
bool isDark = DaisyThemeManager.IsDarkTheme("Dracula");

Key Members

MemberDescription
ApplyTheme(string)Loads and applies a theme by name
CurrentThemeNameCurrently applied theme name
AvailableThemesRead-only list of all theme info
ThemeChangedEvent fired after theme changes
IsDarkTheme(string)Returns whether a theme is dark
The ApplyTheme method is thread-safe and can be called from any thread. The UI will automatically update when the theme changes.

Theme Controls

DaisyThemeDropdown

Dropdown listing all 36 themes with color previews. Automatically syncs with DaisyThemeManager.CurrentThemeName.
<daisy:DaisyThemeDropdown MinWidth="220" />
<daisy:DaisyThemeDropdown SelectedTheme="{x:Bind ViewModel.CurrentTheme, Mode=TwoWay}" />

DaisyThemeController

Flexible toggle between two themes with multiple presentation modes:
<daisy:DaisyThemeController Mode="Toggle" />

DaisyThemeRadio

Radio button for selecting a specific theme. Use GroupName across multiple radios for a theme picker.
<daisy:DaisyThemeRadio ThemeName="Light" GroupName="themes" />
<daisy:DaisyThemeRadio ThemeName="Dark" GroupName="themes" />
<daisy:DaisyThemeRadio ThemeName="Synthwave" GroupName="themes" />

Theme Persistence

When your app persists theme preferences, apply the saved theme before UI construction:
DaisyThemeManager.cs:136-145
protected override void OnLaunched(LaunchActivatedEventArgs args)
{
    // Apply saved theme FIRST - controls will sync to it
    var savedTheme = LoadThemeFromSettings() ?? "Dark";
    DaisyThemeManager.ApplyTheme(savedTheme);

    // Then create the main window
    MainWindow = new MainWindow();
    MainWindow.Activate();
}
Always apply the theme before creating your main window. Controls automatically sync to the current theme on load.

Palette Architecture

Flowery.Uno uses a palette-based architecture for dynamic theme switching:
  1. DaisyPaletteFactory produces per-theme resources with semantic color names
  2. Themes are applied by updating Application.Current.Resources
  3. Stable brush instances are mutated (Color property) to ensure UI updates correctly
  4. Controls use ThemeResource bindings to automatically update when themes change

Key Palette Resources

Base Colors

  • DaisyBase100Brush - Page/window background
  • DaisyBase200Brush - Elevated surfaces (cards, sidebar)
  • DaisyBase300Brush - Borders
  • DaisyBaseContentBrush - Default text/icon color

Semantic Colors

  • DaisyPrimaryBrush - Primary accent color
  • DaisySecondaryBrush - Secondary accent
  • DaisyAccentBrush - Tertiary accent

Status Colors

  • DaisyInfoBrush - Info status color
  • DaisySuccessBrush - Success status color
  • DaisyWarningBrush - Warning status color
  • DaisyErrorBrush - Error status color

Content Colors

  • DaisyPrimaryContentBrush - Text on primary
  • DaisySecondaryContentBrush - Text on secondary
  • DaisyAccentContentBrush - Text on accent

Using Resources in XAML

<!-- Prefer ThemeResource for runtime theme updates -->
<Border Background="{ThemeResource DaisyBase200Brush}"
        BorderBrush="{ThemeResource DaisyBase300Brush}">
    <TextBlock Foreground="{ThemeResource DaisyBaseContentBrush}" Text="Hello"/>
</Border>
Always use ThemeResource instead of StaticResource for colors that should update when themes change.

Uno Platform Considerations

StaticResource vs ThemeResource

StaticResource resolves once at load time. If you swap theme resources later, the UI will not update. Always use ThemeResource for any Daisy palette brushes in XAML:
<!-- ✅ DO: Updates when theme changes -->
<Border Background="{ThemeResource DaisyBase100Brush}" />

<!-- ❌ DON'T: Won't update when theme changes -->
<Border Background="{StaticResource DaisyBase100Brush}" />

ThemeResource Limitations

ThemeResource updates most reliably when the app theme flips Light↔Dark. Switching between two dark themes (e.g., Dracula → Forest) may not trigger updates if you only replace a MergedDictionaries entry. Solution: Flowery.Uno keeps brush instances stable and mutates their Color property when themes change. This is handled internally by DaisyThemeManager.
Critical detail: Do NOT remove and replace the palette ResourceDictionary at runtime. Replacing the dictionary leaves existing ThemeResource bindings pointing at old brush instances.

Lightweight Styling

WinUI/Uno supports “lightweight styling” - overriding theme resources for individual controls without creating full custom styles.

Override a Single Control’s Colors

Place a ResourceDictionary with ThemeDictionaries inside the control’s Resources:
<Button Content="Custom Purple Button">
    <Button.Resources>
        <ResourceDictionary>
            <ResourceDictionary.ThemeDictionaries>
                <ResourceDictionary x:Key="Light">
                    <SolidColorBrush x:Key="ButtonBackground" Color="Transparent"/>
                    <SolidColorBrush x:Key="ButtonForeground" Color="MediumSlateBlue"/>
                    <SolidColorBrush x:Key="ButtonBorderBrush" Color="MediumSlateBlue"/>
                </ResourceDictionary>
                <ResourceDictionary x:Key="Dark">
                    <SolidColorBrush x:Key="ButtonBackground" Color="Transparent"/>
                    <SolidColorBrush x:Key="ButtonForeground" Color="Coral"/>
                    <SolidColorBrush x:Key="ButtonBorderBrush" Color="Coral"/>
                </ResourceDictionary>
            </ResourceDictionary.ThemeDictionaries>
        </ResourceDictionary>
    </Button.Resources>
</Button>

Handle Pointer States

Override state-specific resources using standard suffixes:
StateSuffix Example
HoverButtonBackgroundPointerOver
PressedButtonForegroundPressed
DisabledButtonBorderBrushDisabled

Daisy Control Styling Resources

Flowery.Uno controls support lightweight styling through control-specific resource keys.

Resource Naming Convention

All Daisy styling resources follow this pattern:
Daisy{ControlName}{Part?}{State?}{Property}
Examples:
  • DaisyButtonBackground – Button background
  • DaisyToggleKnobBrush – Toggle switch knob color
  • DaisyTableRowHoverBackground – Table row hover state
  • DaisyInputPrimaryBorderBrush – Primary variant border

Lookup Priority

Resources are resolved in this order:
  1. Control.Resources – Instance-level override (highest priority)
  2. Application.Current.Resources – App-wide override
  3. Fallback – Control’s internal palette logic

Application-Level Styling

Override in App.xaml to affect all instances of a control:
<Application.Resources>
    <ResourceDictionary>
        <SolidColorBrush x:Key="DaisyButtonBackground" Color="MediumSlateBlue"/>
        <SolidColorBrush x:Key="DaisyCardBackground" Color="#2A2A3A"/>
    </ResourceDictionary>
</Application.Resources>

Instance-Level Styling

Override on a single control instance:
<daisy:DaisyButton Content="Custom Button">
    <daisy:DaisyButton.Resources>
        <SolidColorBrush x:Key="DaisyButtonBackground" Color="Coral"/>
        <SolidColorBrush x:Key="DaisyButtonForeground" Color="White"/>
    </daisy:DaisyButton.Resources>
</daisy:DaisyButton>

Control Development Guidelines

When creating custom controls that need to respect themes:

Subscribe to ThemeChanged (with proper lifecycle)

Always subscribe in Loaded and unsubscribe in Unloaded to prevent memory leaks:
DaisyThemeManager.cs:522-555
public MyControl()
{
    InitializeComponent();
    Loaded += OnLoaded;
    Unloaded += OnUnloaded;
}

private void OnLoaded(object sender, RoutedEventArgs e)
{
    DaisyThemeManager.ThemeChanged += OnThemeChanged;
    ApplyTheme();
}

private void OnUnloaded(object sender, RoutedEventArgs e)
{
    DaisyThemeManager.ThemeChanged -= OnThemeChanged;
}

private void OnThemeChanged(object? sender, string themeName)
{
    ApplyTheme();
}

private void ApplyTheme()
{
    Background = DaisyResourceLookup.GetBrush("DaisyBase200Brush");
    Foreground = DaisyResourceLookup.GetBrush("DaisyBaseContentBrush");
}
The DaisyThemeManager.ApplyTheme() method mutates brush colors in-place, which works for code-behind lookups. However, XAML {ThemeResource} bindings do not automatically update when switching between themes of the same Light/Dark category (e.g., Dark → Dracula). Always use code-behind for controls that must update between same-category theme switches.

Use the Right Tokens

Surface TypeToken
Page/window backgroundDaisyBase100Brush
Card/elevated surfaceDaisyBase200Brush
BordersDaisyBase300Brush
Text/iconsDaisyBaseContentBrush
Primary actionsDaisyPrimaryBrush
Success statesDaisySuccessBrush
Error statesDaisyErrorBrush

Debugging Theme Issues

If theme switching appears “dead”:
  1. Check if ThemeChanged fires - persistence depends on this event
  2. Look for exceptions - RequestedTheme can throw silently

Common Issues

Cause: Using StaticResource instead of ThemeResourceFix: Switch to ThemeResource for all Daisy palette brushes
Cause: Missing Foreground bindingFix: Explicitly bind to DaisyBaseContentBrush
Cause: Exception in theme applyFix: Check debug log for errors
Cause: Brushes cached at creationFix: Re-apply brushes on ThemeChanged event

Build docs developers (and LLMs) love