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 GitHubchristian289/dotnet-with-claudecode
wpf-dev-pack
January 23, 2026
Select agents to install to:
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-controlsInstallation paths:
.claude/skills/authoring-wpf-controls/# 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