/wpf-dev-pack:make-wpf-chat-bubble-templatefrom wpf-dev-pack
Generates a role-differentiated chat bubble DataTemplate (color, alignment, asymmetric margin, content-sized) plus turn ViewModel for an ItemsControl of chat turns.
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 chat turn ViewModel name (e.g., ChatTurnViewModel, MessageViewModel)". Do NOT proceed until a valid name is provided. Use the response as the turn ViewModel name for all subsequent steps.
Generate the role-differentiated chat bubble DataTemplate (opposite alignment, distinct background, asymmetric gutter, sized to content) and the $0 turn ViewModel that drives it, for an ItemsControl of chat turns.
{Namespace} with the project's root namespace.MarkdownPresenter (generate it with
/wpf-dev-pack:make-wpf-markdown-presenter) so each turn renders selectable
markdown.The governing rule (full rationale in the
styling-chat-bubbles-in-wpfknowledge topic — fetch viaWpfDevPackMcp get_wpf_topic): declare the base (assistant) values as Style Setters and the per-role override as a DataTrigger Setter — NEVER set a trigger-controlled property (Background,HorizontalAlignment,Margin) as an inline attribute on theBorder. In WPF dependency-property value precedence a local value (an inline attribute) outranks a Style trigger Setter, so an inline attribute silently defeats the roleDataTriggerand both roles render identically.
/wpf-dev-pack:make-wpf-chat-bubble-template ChatTurnViewModel
IsUser discriminates the role; Markdown is the content the streaming
orchestrator appends to. Lives in the ViewModels project (no System.Windows).
Skip this file if
/wpf-dev-pack:make-wpf-chatclientalready emitted a turn ViewModel — emitting both produces a duplicate-type collision. The chatclient's version is this class plus anIsWaitingflag.
namespace {Namespace}.ViewModels;
public sealed partial class $0 : ObservableObject
{
[ObservableProperty] private bool _isUser;
[ObservableProperty] private bool _isWaiting; // "waiting…" until the first streamed token
[ObservableProperty] private string _markdown = string.Empty;
// The streaming orchestrator appends tokens here; the bound MarkdownPresenter re-renders.
public void AppendMarkdown(string delta) => Markdown += delta;
}
The default uses stock-WPF brushes so it builds with no UI-kit package:
<ItemsControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="clr-namespace:{Namespace}.ViewModels;assembly={Namespace}.ViewModels"
xmlns:controls="clr-namespace:{Namespace}.Controls"
ItemsSource="{Binding Turns}">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type vm:$0}">
<Border Padding="10" CornerRadius="6">
<Border.Style>
<Style TargetType="Border">
<!-- DEFAULT = ASSISTANT (response): left, neutral background, right gutter -->
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="Margin" Value="0,4,48,0"/>
<Setter Property="Background" Value="#FFF0F0F0"/>
<Style.Triggers>
<!-- USER (request): right, tinted background, left gutter -->
<DataTrigger Binding="{Binding IsUser}" Value="True">
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="Margin" Value="48,4,0,0"/>
<Setter Property="Background" Value="#FFD6E8FF"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
<!-- content hugs (MarkdownPresenter reports a hug desired width);
the 48px gutter caps max width = parent - 48 -->
<controls:MarkdownPresenter Markdown="{Binding Markdown}"/>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
| Rule | Why |
|---|---|
| Base values = Style Setter; role override = DataTrigger Setter | A local (inline) value outranks a Style trigger Setter, so inline attributes defeat the trigger. |
HorizontalAlignment = Left/Right, never Stretch | Stretch forces the bubble to full width; hugging needs Left/Right and a child that reports a hug width. |
One asymmetric Margin per role | Doubles as the "who sent it" gutter and the max-width cap (parent − gutter); no separate MaxWidth needed. |
Properties constant across roles (Padding, CornerRadius) | Safe to leave as inline attributes — never under trigger control. |
WPF-UI variant — if (and only if) the project references
Wpf.Ui, swap the twoBackgroundSetters for theme-aware kit brushes and addxmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml":{ui:ThemeResource CardBackgroundFillColorDefaultBrush}(assistant) /{ui:ThemeResource SystemAccentColorPrimaryBrush}(user). Declaringxmlns:uiwithout the package installed is an MC3074 build error, and an invalid theme-resource key throwsXamlParseExceptionat render time — use only keys verified to exist in the kit.
{Project}.ViewModels/
└── $0.cs
{Project}.WpfApp/
└── Views/ (place the ItemsControl XAML in the chat view)
WpfDevPackMcp get_wpf_topic): styling-chat-bubbles-in-wpf,
displaying-selectable-rich-text-in-wpf, managing-styles-resourcedictionary,
virtualizing-wpf-ui (for long histories of these bubbles)./wpf-dev-pack:make-wpf-markdown-presenter (the bubble's
content control). This template is one of the pieces emitted by the one-button
/wpf-dev-pack:make-wpf-chatclient.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
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