From wpf-dev-pack
WPF rendering and performance optimization specialist. Optimizes using DrawingContext, DrawingVisual, VirtualizingStackPanel, Freezable patterns, and memory management for high-performance UIs.
How this agent operates — its isolation, permissions, and tool access model
Agent reference
wpf-dev-pack:agents/wpf-performance-optimizersonnetSkills preloaded into this agent's context
The summary Claude sees when deciding whether to delegate to this agent
Optimize WPF rendering performance and memory management for high-performance applications. ```csharp public class OptimizedCanvas : FrameworkElement { private readonly List<Point> _points = []; private Pen? _pen; private Brush? _brush; public OptimizedCanvas() { // Create and freeze resources _pen = new Pen(Brushes.Black, 1); _pen.Freeze(); _brush = Brushes.Blue.Clone(); _brush.Freeze(); } pro...Optimize WPF rendering performance and memory management for high-performance applications.
public class OptimizedCanvas : FrameworkElement
{
private readonly List<Point> _points = [];
private Pen? _pen;
private Brush? _brush;
public OptimizedCanvas()
{
// Create and freeze resources
_pen = new Pen(Brushes.Black, 1);
_pen.Freeze();
_brush = Brushes.Blue.Clone();
_brush.Freeze();
}
protected override void OnRender(DrawingContext dc)
{
base.OnRender(dc);
foreach (var point in _points)
{
dc.DrawEllipse(_brush, _pen, point, 5, 5);
}
}
public void AddPoints(IEnumerable<Point> points)
{
_points.AddRange(points);
// Call InvalidateVisual ONCE after all data added
InvalidateVisual();
}
}
public class VisualHost : FrameworkElement
{
private readonly VisualCollection _children;
public VisualHost()
{
_children = new VisualCollection(this);
}
public void AddVisual(Point position)
{
var visual = new DrawingVisual();
using (var dc = visual.RenderOpen())
{
var brush = Brushes.Red.Clone();
brush.Freeze();
dc.DrawEllipse(brush, null, position, 10, 10);
}
_children.Add(visual);
}
protected override int VisualChildrenCount => _children.Count;
protected override Visual GetVisualChild(int index) => _children[index];
}
@rules/freezable-performance.md
@rules/rendering-antipatterns.md
@rules/virtualization-patterns.md
<Border CacheMode="BitmapCache">
<Border.CacheMode>
<BitmapCache EnableClearType="True"
RenderAtScale="1"
SnapsToDevicePixels="True"/>
</Border.CacheMode>
<!-- Complex visual content -->
</Border>
// Use appropriate dispatcher priority
await Dispatcher.InvokeAsync(() =>
{
// UI update
}, DispatcherPriority.Background);
// For render updates
CompositionTarget.Rendering += OnRendering;
private void OnRendering(object sender, EventArgs e)
{
// Called every frame (~60fps)
}
npx claudepluginhub christian289/dotnet-with-claudecode --plugin wpf-dev-packSubagent suite for WPF .NET desktop development, with specialists in architecture, custom controls, XAML design, MVVM patterns, data binding, performance optimization, code review, C# formatting, and project setup. Delegate complex WPF tasks.
Builds WinUI 3 desktop applications using Windows App SDK, XAML, and C#. Handles new apps, feature additions, conversions from WPF/Electron/web, and bug fixes. Uses Fluent Design guidance and accessibility best practices.
Graphics engineer expert in Vulkan, Metal, DX12 for graphics API implementation, rendering pipelines, GPU resource management, synchronization, bindless techniques, and performance profiling/optimization.