creating-wpf-brushes
Creates WPF Brush patterns including SolidColorBrush, LinearGradientBrush, RadialGradientBrush, ImageBrush, and VisualBrush. Use when filling shapes with colors, gradients, images, or tile patterns.
What this skill does
# 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="#FF9800" Offset="1"/>
</LinearGradientBrush>
</Rectangle.Fill>
<!-- Vertical gradient -->
<Rectangle.Fill>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="White" Offset="0"/>
<GradientStop Color="Black" Offset="1"/>
</LinearGradientBrush>
</Rectangle.Fill>
```
**StartPoint/EndPoint**: Relative coordinates (0-1)
---
## 4. RadialGradientBrush
```xml
<!-- Basic radial -->
<Ellipse Width="200" Height="200">
<Ellipse.Fill>
<RadialGradientBrush>
<GradientStop Color="White" Offset="0"/>
<GradientStop Color="Blue" Offset="1"/>
</RadialGradientBrush>
</Ellipse.Fill>
</Ellipse>
<!-- Off-center highlight (3D sphere effect) -->
<Ellipse.Fill>
<RadialGradientBrush GradientOrigin="0.3,0.3"
Center="0.5,0.5"
RadiusX="0.5" RadiusY="0.5">
<GradientStop Color="White" Offset="0"/>
<GradientStop Color="Blue" Offset="1"/>
</RadialGradientBrush>
</Ellipse.Fill>
```
**GradientOrigin**: Light source position (0-1)
---
## 5. ImageBrush
```xml
<!-- Basic image fill -->
<Rectangle Width="200" Height="200">
<Rectangle.Fill>
<ImageBrush ImageSource="/Assets/texture.png"/>
</Rectangle.Fill>
</Rectangle>
<!-- Tiled pattern -->
<Rectangle.Fill>
<ImageBrush ImageSource="/Assets/pattern.png"
TileMode="Tile"
Viewport="0,0,0.25,0.25"
ViewportUnits="RelativeToBoundingBox"/>
</Rectangle.Fill>
<!-- Stretched (default) -->
<Rectangle.Fill>
<ImageBrush ImageSource="/Assets/background.jpg"
Stretch="UniformToFill"/>
</Rectangle.Fill>
```
**TileMode**: None, Tile, FlipX, FlipY, FlipXY
**Stretch**: None, Fill, Uniform, UniformToFill
---
## 6. VisualBrush
```xml
<!-- Tile visual elements -->
<Rectangle Width="200" Height="200">
<Rectangle.Fill>
<VisualBrush TileMode="Tile"
Viewport="0,0,0.25,0.25"
ViewportUnits="RelativeToBoundingBox">
<VisualBrush.Visual>
<Grid Width="50" Height="50">
<Ellipse Width="20" Height="20" Fill="Red"
HorizontalAlignment="Left" VerticalAlignment="Top"/>
<Ellipse Width="20" Height="20" Fill="Blue"
HorizontalAlignment="Right" VerticalAlignment="Bottom"/>
</Grid>
</VisualBrush.Visual>
</VisualBrush>
</Rectangle.Fill>
</Rectangle>
<!-- Reflection effect -->
<VisualBrush Visual="{Binding ElementName=SourceElement}">
<VisualBrush.RelativeTransform>
<ScaleTransform ScaleY="-1" CenterY="0.5"/>
</VisualBrush.RelativeTransform>
</VisualBrush>
```
---
## 7. DrawingBrush
```xml
<!-- Checkered pattern -->
<Rectangle.Fill>
<DrawingBrush TileMode="Tile"
Viewport="0,0,20,20"
ViewportUnits="Absolute">
<DrawingBrush.Drawing>
<GeometryDrawing Brush="Gray">
<GeometryDrawing.Geometry>
<GeometryGroup>
<RectangleGeometry Rect="0,0,10,10"/>
<RectangleGeometry Rect="10,10,10,10"/>
</GeometryGroup>
</GeometryDrawing.Geometry>
</GeometryDrawing>
</DrawingBrush.Drawing>
</DrawingBrush>
</Rectangle.Fill>
```
---
## 8. Performance Tips
```csharp
// Always Freeze brushes for performance
var brush = new SolidColorBrush(Colors.Blue);
brush.Freeze();
var gradient = new LinearGradientBrush(Colors.Red, Colors.Blue, 0);
gradient.Freeze();
```
**Freeze()**: Makes brush immutable, enables cross-thread sharing, improves rendering performance.
---
## 9. References
- [Painting with Brushes - Microsoft Docs](https://learn.microsoft.com/en-us/dotnet/desktop/wpf/graphics-multimedia/painting-with-solid-colors-and-gradients-overview)
- [TileBrush Overview - Microsoft Docs](https://learn.microsoft.com/en-us/dotnet/desktop/wpf/graphics-multimedia/tilebrush-overview)
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.