Overview

The theming system has three layers that work together:

  • BeepThemesManager — Static manager that discovers IBeepTheme implementations via assembly reflection, fires ThemeChanged events
  • BeepStyling — Central coordinator with 130+ painter classes across 27 design systems (Material3, Fluent2, iOS15, AntDesign, ChakraUI, etc.)
  • BaseControl / BeepiFormPro — All controls and forms subscribe to theme events and re-render automatically

BeepThemesManager — Theme Discovery & Switching

BeepThemesManager is a static class in TheTechIdea.Beep.Winform.Controls.ThemeManagement. On startup it scans all loaded assemblies for classes implementing IBeepTheme and collects them automatically.

Theme initialization and switching

using TheTechIdea.Beep.Winform.Controls.ThemeManagement;

// Call once at startup — scans assemblies via reflection
BeepThemesManager.InitializeThemes();

// Switch theme at runtime — all controls respond automatically
BeepThemesManager.ApplyTheme("MaterialBlue");

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

// Listen for form style changes
BeepThemesManager.FormStyleChanged += (sender, style) =>
{
    Console.WriteLine($"Form style changed to: {style}");
};

Key Members

MemberDescription
InitializeThemes()Scans executing, entry, and all Beep-related assemblies for IBeepTheme classes
ApplyTheme(name)Sets the active theme and fires ThemeChanged
GetTheme(name)Returns a specific IBeepTheme by name
GetDefaultTheme()Returns the fallback theme (DefaultBeepTheme)
ThemeChangedEvent fired when active theme changes
FormStyleChangedEvent fired when form style changes
DpiChangedEvent fired when DPI scale changes

IBeepTheme Interface

Every theme implements IBeepTheme. You can create custom themes by inheriting BeepThemeBase:

Creating a custom theme

using TheTechIdea.Beep.Vis.Modules2;

public class MyCustomTheme : BeepThemeBase, IBeepTheme
{
    public MyCustomTheme()
    {
        ThemeName = "MyCustomTheme";
        
        // Colors
        PrimaryColor = Color.FromArgb(99, 102, 241);
        SecondaryColor = Color.FromArgb(139, 92, 246);
        BackgroundColor = Color.FromArgb(249, 250, 251);
        SurfaceColor = Color.White;
        TextColor = Color.FromArgb(31, 41, 55);
        
        // Typography
        FontFamily = "Inter";
        FontSize = 14f;
        
        // Borders
        BorderRadius = 8;
        BorderWidth = 1;
        BorderColor = Color.FromArgb(229, 231, 235);
    }
}

Themes are auto-discovered: just compile them into any assembly loaded by your app and call InitializeThemes(). No manual registration needed.

BeepStyling — 27 Design Systems

BeepStyling is a static class in TheTechIdea.Beep.Winform.Controls.Styling that coordinates 130+ painter classes across 7 categories:

Painter FolderCountPurpose
BackgroundPainters36Fill backgrounds per design system
BorderPainters27Border drawing (rounded, sharp, glow, etc.)
ShadowPainters27Shadow/elevation effects
SpinnerButtonPainters26Spin button rendering
PathPainters23Shape/path rendering
TextPainters5Text layout and rendering
ImagePainters1Image/SVG rendering (StyledImagePainter)

Additionally, 5 helper systems provide shared utilities: Colors, Spacing, Borders, Shadows, and Typography.

Setting the global control style

using TheTechIdea.Beep.Winform.Controls.Styling;

// Set the global control style — all painters switch to match
BeepStyling.SetControlStyle(BeepControlStyle.Material3);

// Listen for style changes
BeepStyling.ControlStyleChanged += (s, style) =>
{
    Console.WriteLine($"Control style: {style}");
};

BaseControl Painter Kinds

Every control inheriting from BaseControl has a PainterKind property that selects the visual strategy:

PainterKindVisual Style
AutoFollows the global theme & style automatically
ClassicTraditional flat rendering
MaterialMaterial Design with elevation and ripple
CardCard-based layout with shadow
GlassmorphismFrosted glass effect
NeumorphismSoft embossed/debossed look
NeoBrutalistBold outlines, offset shadows
ButtonOptimized for button rendering
ShortcutCardCompact card for shortcuts/actions
ReadingCardCard for readable content
MinimalistMinimal with thin borders

Using PainterKind

var card = new BeepPanel();
card.PainterKind = BaseControlPainterKind.Card;       // Card with shadow
card.Size = new Size(300, 200);

var btn = new BeepButton();
btn.PainterKind = BaseControlPainterKind.Glassmorphism; // Frosted glass
btn.Text = "Glass Button";

BeepiFormPro Form Styles

BeepiFormPro supports 35+ form styles via the FormStyle enum. Each style has a dedicated form painter:

OS Styles

Modern, Minimal, MacOS, Fluent, iOS, Ubuntu, KDE, ArcLinux, GNOME

Design Styles

Material, MaterialYou, Glass, Glassmorphism, NeoMorphism, Brutalist, Neon, Holographic

Editor Themes

Dracula, Solarized, OneDark, GruvBox, Nord, Tokyo

Web/App Styles

Shadcn, RadixUI, NextJS, Linear, Paper, Metro, Metro2

Fun Styles

Cartoon, ChatBubble, Retro, Cyberpunk, Nordic, Terminal

Custom

Use FormStyle.Custom with your own IFormPainter implementation

Setting FormStyle

public class MyApp : BeepiFormPro
{
    public MyApp()
    {
        FormStyle = FormStyle.Cyberpunk; // Try any style
    }
}

Key Classes Summary

ClassNamespaceRole
BeepThemesManagerThemeManagementAuto-discovers themes, fires ThemeChanged events
BeepStylingStylingCentral coordinator for 130+ painters across 27 design systems
BeepThemeBaseVis.Modules2.0Abstract base for custom themes
IBeepThemeVis.Modules2.0Interface all themes implement
StyledImagePainterStyling/ImagePaintersSVG/PNG rendering with theme-aware tinting
PaintersFactoryStylingCreates and caches painter instances per design system