MAUIverse MAUIverse

How to use gradients in .NET MAUI

Gradients are one of the quickest ways to make a cross-platform app look more polished. Héctor starts with the concepts first, using a CSS gradient generator to show what a gradient type, an angle, and a set of gradient stops actually control.

From there he moves to XAML. He sets the Background of a Grid, adds a LinearGradientBrush, and explains how StartPoint and EndPoint choose the direction, for example top to bottom with 0,0 and 0,1. Each GradientStop then gets an Offset between 0 and 1 and a color.

Radial gradients follow the same shape: swap in a RadialGradientBrush and set its Center instead of the start and end points. The screenshots in the post come from a practical app in Héctor’s .NET MAUI course, so it’s a compact reference if you want to try gradients in your own pages.

View Source →

← Back to Community Feed

}