From wpf-dev-pack
Generates WPF UserControls with XAML, C# code-behind including dependency properties, and optional ViewModel using ObservableObject and RelayCommand. For scaffolding new UI components.
How this skill is triggered — by the user, by Claude, or both
Slash command
/wpf-dev-pack:make-wpf-usercontrolhaikuThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**If `$0` is empty, use the AskUserQuestion tool to ask: "Enter the UserControl name (e.g., SearchBox, UserProfile)". Do NOT proceed until a valid name is provided. Use the response as the ControlName for all subsequent steps.**
If $0 is empty, use the AskUserQuestion tool to ask: "Enter the UserControl name (e.g., SearchBox, UserProfile)". Do NOT proceed until a valid name is provided. Use the response as the ControlName for all subsequent steps.
Generate a $0Control UserControl with XAML and code-behind.
If --with-viewmodel is appended, also generate a corresponding ViewModel.
{Namespace} with the project's root namespace detected from csproj or existing code.{Project} with the target project path.# Basic UserControl
/wpf-dev-pack:make-wpf-usercontrol SearchBox
# With ViewModel
/wpf-dev-pack:make-wpf-usercontrol UserProfile --with-viewmodel
<UserControl x:Class="{Namespace}.Controls.$0Control"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="100" d:DesignWidth="300">
<Grid>
<!-- TODO: Add your UI elements here -->
</Grid>
</UserControl>
namespace {Namespace}.Controls;
/// <summary>
/// $0 UserControl.
/// </summary>
public partial class $0Control : UserControl
{
#region Dependency Properties
public static readonly DependencyProperty HeaderProperty =
DependencyProperty.Register(
nameof(Header),
typeof(string),
typeof($0Control),
new PropertyMetadata(string.Empty));
/// <summary>
/// Gets or sets the header text.
/// </summary>
public string Header
{
get => (string)GetValue(HeaderProperty);
set => SetValue(HeaderProperty, value);
}
#endregion
public $0Control()
{
InitializeComponent();
}
}
$0ControlViewModel.cs
namespace {Namespace}.ViewModels;
public partial class $0ControlViewModel : ObservableObject
{
[ObservableProperty] private string _title = string.Empty;
[RelayCommand]
private void Submit()
{
// TODO: Implement submit logic
}
}
$0Control.xaml (with ViewModel)
<UserControl x:Class="{Namespace}.Controls.$0Control"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="clr-namespace:{Namespace}.ViewModels">
<UserControl.DataContext>
<vm:$0ControlViewModel/>
</UserControl.DataContext>
<Grid>
<TextBlock Text="{Binding Title}"/>
</Grid>
</UserControl>
| Aspect | UserControl | CustomControl |
|---|---|---|
| Purpose | Reuse within specific app | Library distribution |
| Styling | Limited | Full ControlTemplate replacement |
| Complexity | Low | High |
| Creation | XAML + Code-behind | Class + Generic.xaml |
{Project}/
├── Controls/
│ ├── $0Control.xaml
│ └── $0Control.xaml.cs
└── ViewModels/
└── $0ControlViewModel.cs (with --with-viewmodel option)
Use DependencyProperty to receive external bindings in UserControl:
public static readonly DependencyProperty ValueProperty =
DependencyProperty.Register(
nameof(Value),
typeof(string),
typeof($0Control),
new FrameworkPropertyMetadata(
string.Empty,
FrameworkPropertyMetadataOptions.BindsTwoWayByDefault,
OnValueChanged));
public string Value
{
get => (string)GetValue(ValueProperty);
set => SetValue(ValueProperty, value);
}
private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
if (d is $0Control control)
{
// Handle value change
}
}
<!-- Usage example -->
<local:$0Control Value="{Binding MyValue, Mode=TwoWay}"/>
npx claudepluginhub christian289/dotnet-with-claudecode --plugin wpf-dev-packGenerates WPF CustomControl C# class and XAML ControlTemplate style from a control name. Use when creating a new custom control, scaffolding a templated control, or generating CustomControl boilerplate code.
Designs WinUI 3 UIs and reviews XAML for correctness, covering layout planning, control selection, Fluent Design, theming (Light/Dark/HighContrast), typography, spacing, brushes, accessibility, and data binding.
Provides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.