Loading...
Loading...
Implement and customize themes for Syncfusion WPF controls using SfSkinManager. Apply built-in themes (Windows 11, Fluent, Material, Office 2019), create custom themes with Theme Studio, and control visual effects like reveal animations and acrylic backgrounds. Use this skill whenever user needs to theme WPF applications, apply Syncfusion themes, customize colors/fonts, or configure theme-based visual effects and accessibility features.
npx skill4agent add syncfusion/wpf-ui-components-skills syncfusion-wpf-theming<Window x:Class="MyApp.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:syncfusionskin="clr-namespace:Syncfusion.SfSkinManager;assembly=Syncfusion.SfSkinManager.WPF"
syncfusionskin:SfSkinManager.Theme="{syncfusionskin:SkinManagerExtension ThemeName=Windows11Light}">
<Grid>
<!-- Your controls here - theme automatically applied -->
</Grid>
</Window>using Syncfusion.SfSkinManager;
public partial class MainWindow : Window
{
public MainWindow()
{
// Enable theme as default style
SfSkinManager.ApplyThemeAsDefaultStyle = true;
// Apply theme to this window and all child controls
SfSkinManager.SetTheme(this, new Theme("Windows11Light"));
InitializeComponent();
}
}public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
SfSkinManager.ApplyThemeAsDefaultStyle = true;
SfSkinManager.ApplicationTheme = new Theme("Fluent
Dark");
base.OnStartup(e);
}
}// Example: Switch theme when user selects from dropdown
private void OnThemeSelectionChanged(string themeName)
{
SfSkinManager.SetTheme(this, new Theme(themeName));
}string customThemeName = "MyCustomTheme";
string baseThemeName = "Windows11Light";
// Register custom theme (assuming custom theme assembly is referenced)
SkinHelper customThemeInstance = new MyCustomThemeSkinHelper();
SfSkinManager.RegisterTheme(customThemeName, customThemeInstance);
// Apply the custom theme
SfSkinManager.SetTheme(this, new Theme($"{customThemeName};{baseThemeName}"));// Example: Customize Windows 11 Light theme colors
var themeSettings = new Windows11LightThemeSettings();
themeSettings.Palette = new Windows11Palette
{
PrimaryColor = Colors.Blue,
SecondaryColor = Colors.LightBlue
};
SfSkinManager.RegisterThemeSettings("Windows11Light", themeSettings);
SfSkinManager.SetTheme(this, new Theme("Windows11Light"));| Property | Purpose | Type | Default |
|---|---|---|---|
| Applied theme name (XAML attached property) | string | None |
| Global theme for entire application | Theme object | None |
| Visual effect on hover (Fluent theme) | HoverEffect enum | BackgroundAndBorder |
| Visual effect on press (Fluent theme) | PressedEffect enum | Reveal |
| Enable acrylic blur effect (Fluent theme) | bool | false |
| Apply theme as default style resource | bool | false |