veloxdev-switch-themes

Implements runtime theme switching with animated transitions in VeloxDev .NET applications.

37|12|Updated Jun 5, 2025
One-click install
npx skills add https://github.com/Axvser/VeloxDev --skill veloxdev-switch-themes-axvser
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: veloxdev-switch-themes
Source: https://github.com/Axvser/VeloxDev/tree/main/skills/veloxdev-switch-themes
Command: npx skills add https://github.com/Axvser/VeloxDev --skill veloxdev-switch-themes-axvser

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Hard-coding per-theme branches in view code makes runtime theme switching tedious and error-prone in .NET GUI apps. This Skill lets a property's value depend on the current theme and switches themes at runtime—instantly or animated—without writing any per-theme branching logic. ## Core Features & Use Cases - Declarative Theme Configuration: Mark properties with [ThemeConfig] attributes naming a converter and per-theme values; the source generator wires registration, startup application, and switching machinery. - Animated or Instant Switching: Switch themes with ThemeManager.SetCurrent, Jump, or Transition, with full timeline control (pause, resume, seek, rate, exit) over in-flight animated switches. - Runtime Theme Editing: Override declared theme values at runtime with SetThemeValue / RestoreThemeValue and react to changes via generated OnThemeChanging / OnThemeChanged partial methods. - Use Case: A WPF or Avalonia app needs a light/dark mode toggle where window backgrounds and foregrounds animate smoothly between themes—declare the properties once, call InitializeTheme(), and switch with one line. ## Quick Start Add a dark/light theme toggle to my VeloxDev WPF MainWindow with animated background and foreground transitions.

Frequently Asked Questions about veloxdev-switch-themes

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add runtime theme switching to a VeloxDev app?

Declare themeable properties with [ThemeConfig] attributes on a partial class, naming a converter and one value array per theme. Call the generated InitializeTheme() after InitializeComponent(), then switch with ThemeManager.SetCurrent, Jump, or Transition.

How do I animate a theme change in WPF or Avalonia?

Call ThemeManager.SetPlatformInterpolator(new Interpolator()) during startup, then switch with ThemeManager.Transition<Theme>(TransitionEffects.Theme). Without a registered interpolator the switch applies instantly with no animation and no warning.

Which NuGet packages does VeloxDev theming require?

Two packages are required: VeloxDev.Core provides ITheme, [ThemeConfig], ThemeManager, and the generator, while a GUI adapter such as VeloxDev.WPF or VeloxDev.Avalonia supplies the value converters and interpolator. Core alone cannot convert theme values into platform types like Brush.

Why is my VeloxDev theme switch not animating?

The most common cause is a missing ThemeManager.SetPlatformInterpolator call, which makes every switch apply instantly. Also verify the class is partial, InitializeTheme() runs after InitializeComponent(), and the property type has a sampler.

Why does my [ThemeConfig] property never change with the theme?

Property names are matched by string at build time and unresolved names are dropped silently, so check the spelling first. Also confirm the class is partial and you use at most six themes, since seven-theme declarations compile but generate nothing.

Can I change a theme's values at runtime in VeloxDev?

Yes, the generator emits SetThemeValue and RestoreThemeValue accessors on the class to override or reset individual values per theme. Pass the value as new object?[] { ... } since collection expressions do not compile for the plain object? parameter.