SolidColorBrush is used to draw graphics objects with a solid color. This article shows how to use SolidColorBrush element of XAML.
The <SolidColorBrush/> represents the solid color brush in XAML. The Color attribute of the tag represents the color used in the brush. For example, the following code creates a solid color brush with blue color.
<SolidColorBrush Color="Blue" />
The Color attribute can also be a hex value instead of the color name. The following code uses hex value of a color.
<SolidColorBrush Color="#FFFFFF" />
The following code fills a rectangle with black color.
The output looks like Figure 1, which is a filled rectangle with black color.
Figure 1. Rectangle with a solid brush
You may also want to read these related articles.
Ask Your Question
Got a programming related question? You may want to post your question here