#530 – Creating a Linear Gradient in Blend

A linear gradient is a fill style that fills an area with a pattern that starts out as one color and gradually changes to one or more other colors.

You can create a linear gradient directly in XAML using the <LinearGradientBrush> element.  You can also use the the tools in Blend to create a gradient.

Let’s create a new gradient to use as the background brush for a Window.  Start by selecting the window object.

Now click the Background property on the Properties panel.

Select the gradient brush option.

You’ll see that the default gradient has two gradient stops, going from black to white.

Click on the black gradient stop and select a new color in the color palette.  This will change the first gradient stop, so the gradient will now run from your new color, to white.

Your Window now has a gradient background.

About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

One Response to #530 – Creating a Linear Gradient in Blend

  1. Pingback: #558 – Reversing a Gradient Using Blend « 2,000 Things You Should Know About WPF

Leave a comment