Claude Skills
CollectionsCompareWorkflowsNominate
Sign inSign up
© 2026 Curated Agent Skills·Learn more about Agent Skills
Back to repository

creating-graphics-in-code

verified

Creates WPF graphics dynamically in C# code using Shape, PathGeometry, and PathFigure classes. Use when building charts, diagrams, or procedurally generated graphics.

View on GitHub

Marketplace

dotnet-claude-plugins

christian289/dotnet-with-claudecode

Plugin

wpf-dev-pack

development

Repository

christian289/dotnet-with-claudecode
6stars

wpf-dev-pack/skills/creating-graphics-in-code/SKILL.md

Last Verified

February 1, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/christian289/dotnet-with-claudecode/blob/main/wpf-dev-pack/skills/creating-graphics-in-code/SKILL.md -a claude-code --skill creating-graphics-in-code

Installation paths:

Claude
.claude/skills/creating-graphics-in-code/
Powered by add-skill CLI

Instructions

# Creating WPF Graphics in Code

Programmatically create shapes and geometry for dynamic graphics.

## 1. Shape Factory Pattern

```csharp
namespace MyApp.Graphics;

using System.Windows;
using System.Windows.Media;
using System.Windows.Shapes;

public static class ShapeFactory
{
    /// <summary>
    /// Create circular marker
    /// </summary>
    public static Ellipse CreateCircle(double size, Brush fill, Brush? stroke = null)
    {
        var ellipse = new Ellipse
        {
            Width = size,
            Height = size,
            Fill = fill
        };

        if (stroke is not null)
        {
            ellipse.Stroke = stroke;
            ellipse.StrokeThickness = 1;
        }

        return ellipse;
    }

    /// <summary>
    /// Create rectangle with optional corner radius
    /// </summary>
    public static Rectangle CreateRectangle(
        double width,
        double height,
        Brush fill,
        double cornerRadius = 0)
    {
        return new Rectangle
        {
            Width = width,
            Height = height,
            Fill = fill,
            RadiusX = cornerRadius,
            RadiusY = cornerRadius
        };
    }

    /// <summary>
    /// Create line between two points
    /// </summary>
    public static Line CreateLine(Point start, Point end, Brush stroke, double thickness = 1)
    {
        return new Line
        {
            X1 = start.X,
            Y1 = start.Y,
            X2 = end.X,
            Y2 = end.Y,
            Stroke = stroke,
            StrokeThickness = thickness
        };
    }
}
```

---

## 2. Geometry Builder Pattern

```csharp
namespace MyApp.Graphics;

using System.Collections.Generic;
using System.Windows;
using System.Windows.Media;

public static class GeometryBuilder
{
    /// <summary>
    /// Create polygon from points
    /// </summary>
    public static PathGeometry CreatePolygon(IReadOnlyList<Point> points)
    {
        if (points.Count < 3)
            return new PathGeometr

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
6334 chars