/wpf-dev-pack:make-wpf-behaviorfrom wpf-dev-pack
Generates WPF Behavior<T> classes using Microsoft.Xaml.Behaviors.Wpf. Scaffolds reusable interaction logic for controls like drag, focus, or input behaviors.
Ships in wpf-dev-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
If $0 is empty, use the AskUserQuestion tool to ask: "Enter the Behavior name (e.g., SelectAllOnFocus, DragMove)". Do NOT proceed until a valid name is provided. Use the response as the BehaviorName for all subsequent steps.
Generate a $0Behavior class based on Microsoft.Xaml.Behaviors.Wpf.
{TargetType} with the appropriate WPF type (e.g., TextBox, UIElement, Window) based on the behavior name and context.{Namespace} with the project's root namespace detected from csproj or existing code.{Project} with the target project path.namespace {Namespace}.Behaviors;
public sealed class $0Behavior : Behavior<{TargetType}>
{
#region Dependency Properties
public static readonly DependencyProperty IsEnabledProperty =
DependencyProperty.Register(
nameof(IsEnabled),
typeof(bool),
typeof($0Behavior),
new PropertyMetadata(true));
public bool IsEnabled
{
get => (bool)GetValue(IsEnabledProperty);
set => SetValue(IsEnabledProperty, value);
}
#endregion
#region Lifecycle
protected override void OnAttached()
{
base.OnAttached();
AssociatedObject.Loaded += OnLoaded;
}
protected override void OnDetaching()
{
base.OnDetaching();
AssociatedObject.Loaded -= OnLoaded;
}
#endregion
#region Event Handlers
private void OnLoaded(object sender, RoutedEventArgs e)
{
if (!IsEnabled)
{
return;
}
// TODO: Implement behavior logic
}
#endregion
}
<Window xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
xmlns:behaviors="clr-namespace:{Namespace}.Behaviors">
<{TargetType}>
<b:Interaction.Behaviors>
<behaviors:$0Behavior IsEnabled="{Binding IsBehaviorEnabled}"/>
</b:Interaction.Behaviors>
</{TargetType}>
</Window>
public sealed class FocusOnLoadBehavior : Behavior<UIElement>
{
protected override void OnAttached()
{
base.OnAttached();
AssociatedObject.Loaded += (s, e) => AssociatedObject.Focus();
}
}
public sealed class EnterKeyBehavior : Behavior<TextBox>
{
public static readonly DependencyProperty CommandProperty =
DependencyProperty.Register(nameof(Command), typeof(ICommand),
typeof(EnterKeyBehavior));
public ICommand? Command
{
get => (ICommand?)GetValue(CommandProperty);
set => SetValue(CommandProperty, value);
}
protected override void OnAttached()
{
base.OnAttached();
AssociatedObject.KeyDown += OnKeyDown;
}
protected override void OnDetaching()
{
base.OnDetaching();
AssociatedObject.KeyDown -= OnKeyDown;
}
private void OnKeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
{
Command?.Execute(AssociatedObject.Text);
}
}
}
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.*" />
{Project}/
└── Behaviors/
└── $0Behavior.cs
| DO | DON'T |
|---|---|
| Unsubscribe events in OnDetaching | Missing event unsubscription (memory leak) |
| Expose settings via DependencyProperty | Use hardcoded values |
| Apply IsEnabled pattern | Always execute without condition |
| Check AssociatedObject for null | Use without null check |
/wpf-dev-pack:make-wpf-chatclient emits two worked Behavior<T> instances
built on this template: an EnterCommandBehavior (Enter=send / Shift+Enter=newline,
IME-safe, via PreviewKeyDown with a Command/CommandParameter DP pair) and a
StickToBottomBehavior (pin a streaming ScrollViewer to the newest content unless
the user scrolled up). See it for a Command-DP behavior and an event-tracking behavior
in context.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub christian289/dotnet-with-claudecode --plugin wpf-dev-pack28 skills in this plugin
/collecting-wpf-dev-pack-feedbackCollecting wpf-dev-pack FeedbackAnalyzes the current WPF working session and produces an accumulable wpf-dev-pack improvement-feedback markdown file in the current directory. Use when, after doing WPF work with wpf-dev-pack skills/scaffolders in a project OUTSIDE the dotnet-with-claudecode repo, you want to capture anti-patterns you hand-fixed, missing or outdated skill guidance, mistaken or missed triggers, and scaffolder gaps — without editing wpf-dev-pack directly. The output md is meant to be contributed to dotnet-with-claudecode/FeedbackDocs via a pull request./configuring-wpf-dev-pack-languageConfiguring wpf-dev-pack LanguageConfigures the user-facing response language for the wpf-dev-pack plugin by writing a per-project preference file at .claude/wpf-dev-pack.local.md. Use when starting work with wpf-dev-pack in a new project and the default language does not match the user's expectation, or when switching language mid-project. The setting is read by the LanguagePreferenceLoader SessionStart hook on the next conversation start and takes effect automatically from then on.Other plugins' skills for the same job