developing-wpf-customcontrols

developing-wpf-customcontrols is a skill for Claude Code from christian289/dotnet-with-claudecode. It costs 37 tokens per session (1,404 once invoked), scanned A, original, MIT.

A guide to building WPF custom controls whose appearance can be changed with templates. WPF is Microsoft's Windows desktop UI framework.

In plain words
What is it for?
Creating controls with TemplatePart and TemplateVisualState declarations, applying templates, and managing visual states with VisualStateManager.
Why use it?
It helps choose between a simple reusable control and a fully themeable control, then define the parts and visual states the control expects.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: model in frontmatter.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/christian289/dotnet-with-claudecode/developing-wpf-customcontrols
Any agent
npx skills add christian289/dotnet-with-claudecode --skill developing-wpf-customcontrols
Clone the repo
git clone --depth 1 https://github.com/christian289/dotnet-with-claudecode

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for developing-wpf-customcontrols

README.md
[![agentmods](https://agentmods.dev/badge/skills/christian289/dotnet-with-claudecode/developing-wpf-customcontrols.svg)](https://agentmods.dev/skills/christian289/dotnet-with-claudecode/developing-wpf-customcontrols)
Your own site
<a href="https://agentmods.dev/skills/christian289/dotnet-with-claudecode/developing-wpf-customcontrols"><img src="https://agentmods.dev/badge/skills/christian289/dotnet-with-claudecode/developing-wpf-customcontrols.svg" alt="Measured on agentmods" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,404 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00037 $0.01404
Opus 5 $0.00018 $0.00702
Sonnet 5 $0.00007 $0.00281
Haiku 4.5 $0.00004 $0.00140

Measured 6d ago against content hash 1c1f288986be, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

developing-wpf-customcontrols scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

archive-skills/developing-wpf-customcontrols/SKILL.md · 195 lines

How it starts

The opening of the file, as written. The whole thing — 195 lines — stays where its author put it; the contents beside it link to each section on GitHub.

WPF CustomControl Development - Parts and States Model

Workflow for developing WPF CustomControls with appearance customization capability.

Development Flow

1. Control Inheritance Decision

UserControl Selection Criteria:
- Need rapid development
- ControlTemplate customization not required
- Complex theme support not required

Control Inheritance Selection Criteria:
- Need appearance customization via ControlTemplate
- Need various theme support
- Need same extensibility as WPF built-in controls

2. Define Control Contract

Declare TemplatePart and TemplateVisualState attributes on the class:

[TemplatePart(Name = PartUpButton, Type = typeof(RepeatButton))]
[TemplatePart(Name = PartDownButton, Type = typeof(RepeatButton))]
[TemplateVisualState(Name = StatePositive, GroupName = GroupValueStates)]
[TemplateVisualState(Name = StateNegative, GroupName = GroupValueStates)]
[TemplateVisualState(Name = StateFocused, GroupName = GroupFocusStates)]
[TemplateVisualState(Name = StateUnfocused, GroupName = GroupFocusStates)]
public class NumericUpDown : Control
{
    // Define Part/State names as const
    private const string PartUpButton = "PART_UpButton";
    private const string PartDownButton = "PART_DownButton";
    private const string GroupValueStates = "ValueStates";
    private const string GroupFocusStates = "FocusStates";
    private const string StatePositive = "Positive";
    private const string StateNegative = "Negative";
    private const string StateFocused = "Focused";
    private const string StateUnfocused = "Unfocused";
}

3. Template Part Property Pattern

Wrap Part elements as private properties, subscribe/unsubscribe events in setter:

private RepeatButton? _upButton;
private RepeatButton? UpButtonElement
{
    get => _upButton;
    set
    {
        // Unsubscribe from existing element's events
        if (_upButton is not null)
            _upButton.Click -= OnUpButtonClick;

        _upButton = value;

        // Subscribe to new element's events
        if (_upButton is not null)
            _upButton.Click += OnUpButtonClick;
    }
}

Read the full file on GitHub · 195 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 195 lines · 37 tokens per session scan A 1c1f288986be

Subscribe to this mod's changes

developing-wpf-customcontrols is a skill published in the GitHub repository christian289/dotnet-with-claudecode (41 stars, last pushed 1mo ago), licensed MIT. It adds 37 tokens to every session and 1,404 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

semantic-kernel

Build AI-enabled .NET applications with Semantic Kernel using services, plugins, prompts, and function-calling patterns that remain testable and maintainable. USE FOR: adding AI-driven prompts, plugins, or orchestration to a .NET app; reviewing kernel construction, service registration, or plugin usage; building…

managedcode/dotnet-skills · 116 tokens

microsoft-extensions-ai

Build provider-agnostic .NET AI integrations with Microsoft.Extensions.AI, IChatClient, embeddings, middleware, structured output, vector search, and evaluation. USE FOR: building or reviewing .NET code that uses Microsoft.Extensions.AI, Microsoft.Extensions.AI.Abstractions, IChatClient, IEmbeddingGenerator…

managedcode/dotnet-skills · 128 tokens

sep

Use Sep for high-performance separated-value parsing and writing in .NET, including delimiter inference, explicit parser/writer options, and low-allocation row/column workflows. USE FOR: delimited data needs are performance-sensitive and allocation-aware; project needs explicit control over separator inference…

managedcode/dotnet-skills · 113 tokens

managedcode-markitdown

Use ManagedCode.MarkItDown when a .NET application needs deterministic document-to-Markdown conversion for ingestion, indexing, summarization, or content-processing workflows. USE FOR: ManagedCode.MarkItDown integration; document ingestion flows; Office or rich-text conversion to Markdown; indexing and summarization…

managedcode/dotnet-skills · 113 tokens

maui-essentials-ai

Adopt Microsoft.Maui.Essentials.AI for local/on-device MAUI AI. USE FOR: Apple Intelligence chat, IChatClient, iOS/macOS/Mac Catalyst 26+ checks, fallback UI, NLEmbeddingGenerator, local tool invocation, privacy/offline UX. DO NOT USE FOR: source-generated tools, cloud-only AI, UI debugging.

dotnet/maui-labs · 86 tokens

mlnet

Use ML.NET to train, evaluate, or integrate machine-learning models into .NET applications with realistic data preparation, inference, and deployment expectations. USE FOR: ML.NET integration; local model training or retraining; inference pipelines, model loading, evaluation, and deployment review. DO NOT USE FOR…

managedcode/dotnet-skills · 105 tokens