← ClaudeAtlas

make-wpf-behaviorlisted

Generates WPF Behavior<T> classes using Microsoft.Xaml.Behaviors.Wpf. Use when adding reusable interaction logic to controls, creating drag behaviors, or scaffolding a new Behavior class. Usage: /wpf-dev-pack:make-wpf-behavior <BehaviorName>
christian289/dotnet-with-claudecode · ★ 41 · AI & Automation · score 73
Install: claude install-skill christian289/dotnet-with-claudecode
# WPF Behavior Generator **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. - Replace `{TargetType}` with the appropriate WPF type (e.g., TextBox, UIElement, Window) based on the behavior name and context. - Replace `{Namespace}` with the project's root namespace detected from csproj or existing code. - Replace `{Project}` with the target project path. ## Generated Code ```csharp 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