Back to Skills

authoring-wpf-controls

verified

Guides decision-making for WPF control authoring including UserControl vs Control vs FrameworkElement selection. Use when creating new controls or evaluating Style/Template/Trigger alternatives.

View on GitHub

Marketplace

dotnet-claude-plugins

christian289/dotnet-with-claudecode

Plugin

wpf-dev-pack

development

Repository

christian289/dotnet-with-claudecode
5stars

wpf-dev-pack/skills/authoring-wpf-controls/SKILL.md

Last Verified

January 23, 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/authoring-wpf-controls/SKILL.md -a claude-code --skill authoring-wpf-controls

Installation paths:

Claude
.claude/skills/authoring-wpf-controls/
Powered by add-skill CLI

Instructions

# WPF Control Authoring Guide

A guide for decision-making when authoring WPF controls.

## 1. Do You Need a New Control?

**Review alternatives first.** Thanks to WPF's extensibility, most requirements can be solved without creating a new control.

| Requirement | Alternative | Example |
|-------------|-------------|---------|
| Change appearance only | Style | Unify TextBlock to red Arial 14pt |
| Change control structure | ControlTemplate | Make RadioButton look like traffic light |
| Change data display method | DataTemplate | Add checkbox to ListBox items |
| Change state-based behavior | Trigger | Make selected item bold red |
| Display composite content | Rich Content | Show image+text together in Button |

**When a new control is needed:**

- New functionality/behavior not available in existing controls
- Reusable composite components
- Special input/interaction patterns

---

## 2. Base Class Selection

```
┌─────────────────────────────────────────────────────────────┐
│                    Control Type Decision                    │
├─────────────────────────────────────────────────────────────┤
│                                                             │
│  ┌─────────────┐    ┌─────────────┐    ┌─────────────────┐  │
│  │ UserControl │    │   Control   │    │ FrameworkElement│  │
│  └──────┬──────┘    └──────┬──────┘    └────────┬────────┘  │
│         │                  │                    │           │
│  Combine existing    ControlTemplate      Direct rendering  │
│  Quick development   Customization        Full control      │
│  No template         Theme support        Performance       │
│                                           optimization      │
└─────────────────────────────────────────────────────────────┘
```

### UserControl Selection Criteria

- ✅ Combining existing controls is sufficient
- ✅ Prefer application-like development approach
- ✅ ControlTemplate customization not needed
- ❌ Theme support not needed

### Control Selection Crite

Validation Details

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