代码:
RadialGradientBrush rgbrush = new RadialGradientBrush();
rgbrush.RadiusX = 0.5;
rgbrush.RadiusY = 1;
rgbrush.GradientStops.Add(new GradientStop((Color)ColorConverter.ConvertFromString("#FF4682D6"), 0.45));
rgbrush.GradientStops.Add(new GradientStop((Color)ColorConverter.ConvertFromString("#FF3867CC"), 0.87));
Control.Background = rgbrush;
Xaml:
<Control.Background >
<RadialGradientBrush RadiusY="1" RadiusX="0.5">
<GradientStop Color="#FF4682D6" Offset="0.45"/>
<GradientStop Color="#FF3867CC" Offset="0.869"/>
</RadialGradientBrush>
</Control.Background >
效果如下图: