Claude Skills
CollectionsCompareWorkflowsNominate
Sign inSign up
© 2026 Curated Agent Skills·Learn more about Agent Skills
Back to repository

configuring-wpf-themeinfo

verified

Configures ThemeInfo attribute in AssemblyInfo.cs for WPF CustomControl Generic.xaml auto-loading. Use when creating WPF Custom Control Library projects or troubleshooting missing control styles.

View on GitHub

Marketplace

dotnet-claude-plugins

christian289/dotnet-with-claudecode

Plugin

wpf-dev-pack

development

Repository

christian289/dotnet-with-claudecode
6stars

wpf-dev-pack/skills/configuring-wpf-themeinfo/SKILL.md

Last Verified

February 1, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/christian289/dotnet-with-claudecode/blob/main/wpf-dev-pack/skills/configuring-wpf-themeinfo/SKILL.md -a claude-code --skill configuring-wpf-themeinfo

Installation paths:

Claude
.claude/skills/configuring-wpf-themeinfo/
Powered by add-skill CLI

Instructions

# WPF ThemeInfo Configuration

Configuring the `ThemeInfo` attribute for automatic Generic.xaml loading in WPF Custom Control Library projects.

## Overview

WPF uses the `ThemeInfo` attribute to locate theme-specific and generic resource dictionaries at runtime. Without this attribute, `Themes/Generic.xaml` will **not** be loaded automatically, and CustomControl styles will not be applied.

---

## 1. AssemblyInfo.cs Configuration

### Required Code

```csharp
// Properties/AssemblyInfo.cs
using System.Windows;

[assembly: ThemeInfo(
    ResourceDictionaryLocation.None,            // Theme-specific resources
    ResourceDictionaryLocation.SourceAssembly)]  // Generic resources (Themes/Generic.xaml)
```

### File Location

```
YourProject/
├── Properties/
│   └── AssemblyInfo.cs    ← ThemeInfo attribute here
├── Themes/
│   └── Generic.xaml       ← Auto-loaded by ThemeInfo
└── CustomButton.cs
```

---

## 2. ResourceDictionaryLocation Options

| Value | Description | Use Case |
|-------|-------------|----------|
| `None` | No resource dictionary for this category | Theme-specific: when no OS theme customization needed |
| `SourceAssembly` | Resources in the current assembly | Generic: load from `Themes/Generic.xaml` in this assembly |
| `ExternalAssembly` | Resources in a separate assembly | When themes are packaged in `YourAssembly.ThemeName.dll` |

### Parameter Meanings

```csharp
[assembly: ThemeInfo(
    themeDictionaryLocation,    // 1st: Theme-specific (e.g., Aero, Luna)
    genericDictionaryLocation)] // 2nd: Generic fallback (Themes/Generic.xaml)
```

- **1st parameter** (`themeDictionaryLocation`): OS theme-specific styles (rarely used)
- **2nd parameter** (`genericDictionaryLocation`): Generic.xaml location (**must be `SourceAssembly`**)

---

## 3. Anti-Pattern: App.xaml MergedDictionaries

### Bad Example

```xml
<!-- App.xaml - DO NOT DO THIS for CustomControl styles -->
<Application.Resources>
    <ResourceDictionary>
        <ResourceDictionary.Merge

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
3954 chars