fixing-avaloniaui-radialgradientbrush

Fixes RadialGradientBrush GradientOrigin and Center mismatches when converting WPF XAML to AvaloniaUI.

Updated Nov 22, 2023
One-click install
npx skills add https://github.com/parksanghoon-sys/TestCode --skill fixing-avaloniaui-radialgradientbrush-parksanghoon-sys
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: fixing-avaloniaui-radialgradientbrush
Source: https://github.com/parksanghoon-sys/TestCode/tree/main/src/Modbus/.agents/skills/fixing-avaloniaui-radialgradientbrush
Command: npx skills add https://github.com/parksanghoon-sys/TestCode --skill fixing-avaloniaui-radialgradientbrush-parksanghoon-sys

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? AvaloniaUI's RadialGradientBrush does not render correctly when GradientOrigin and Center have different values (AvaloniaUI Issue #19888), which breaks WPF-to-AvaloniaUI XAML migrations that rely on offset radial gradients. ## Core Features & Use Cases - Mismatch Detection: Scans WPF XAML for RadialGradientBrush elements and compares GradientOrigin and Center values. - Guided Resolution: Presents the user with a choice to unify both properties to either the GradientOrigin value or the Center value, never changing values arbitrarily. - Use Case: When migrating a WPF control with <RadialGradientBrush GradientOrigin="20%,20%" Center="28%,28%"> to AvaloniaUI, the Skill detects the mismatch and asks which value to apply to both properties so the gradient renders correctly. ## Quick Start Convert this WPF RadialGradientBrush XAML to AvaloniaUI and fix any GradientOrigin and Center mismatch.

Frequently Asked Questions about fixing-avaloniaui-radialgradientbrush

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert WPF RadialGradientBrush to AvaloniaUI?▼

Compare the GradientOrigin and Center values in the WPF XAML. If they differ, unify both properties to the same value, since AvaloniaUI requires them to be identical for the gradient to render correctly.

Why does RadialGradientBrush not render in AvaloniaUI?▼

AvaloniaUI Issue #19888 causes RadialGradientBrush to fail when GradientOrigin differs from Center and the first GradientStop is transparent. Setting both properties to the same value resolves the rendering problem.

Does AvaloniaUI support different GradientOrigin and Center values?▼

No, AvaloniaUI currently requires GradientOrigin and Center to be identical for RadialGradientBrush to work properly. This differs from WPF, where the two properties can be set independently.

What happens if only GradientOrigin or Center is specified in XAML?▼

When only one of the two properties is explicitly set, the unspecified property is automatically assigned the same value as the specified one, keeping them identical and avoiding the rendering issue.

Should I unify to GradientOrigin or Center when migrating to AvaloniaUI?▼

The choice depends on the intended visual result, so the user must decide. Unifying to GradientOrigin preserves the gradient's origin point, while unifying to Center preserves the gradient's center position.