creating-wpf-brusheslisted
Install: claude install-skill christian289/dotnet-with-claudecode
# WPF Brush Patterns
Brush types for filling shapes and backgrounds in WPF.
## 1. Brush Hierarchy
```
Brush (abstract)
├── SolidColorBrush ← Single color
├── GradientBrush
│ ├── LinearGradientBrush ← Linear gradient
│ └── RadialGradientBrush ← Radial gradient
├── TileBrush
│ ├── ImageBrush ← Image fill
│ ├── DrawingBrush ← Drawing fill
│ └── VisualBrush ← Visual element fill
└── BitmapCacheBrush ← Cached visual
```
---
## 2. SolidColorBrush
```xml
<!-- Inline color name -->
<Rectangle Fill="Blue"/>
<!-- Hex color -->
<Rectangle Fill="#FF2196F3"/>
<!-- With opacity -->
<Rectangle>
<Rectangle.Fill>
<SolidColorBrush Color="Blue" Opacity="0.5"/>
</Rectangle.Fill>
</Rectangle>
```
```csharp
// Code creation
var brush = new SolidColorBrush(Colors.Blue);
brush.Opacity = 0.5;
brush.Freeze(); // Performance optimization
```
---
## 3. LinearGradientBrush
```xml
<!-- Horizontal gradient (default) -->
<Rectangle Width="200" Height="100">
<Rectangle.Fill>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
<GradientStop Color="#2196F3" Offset="0"/>
<GradientStop Color="#FF9800" Offset="1"/>
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
<!-- Diagonal gradient -->
<Rectangle.Fill>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Color="#2196F3" Offset="0"/>
<GradientStop Color="#4CAF50" Offset="0.5"/>
<GradientStop Color="#