Border

Consider the Border control as a special container that draws a border around the child control, with the specified color, thickness, and corner radius. The following XAML code draws a red border with a depth of 3 around a rectangle:

image

Changes are immediately visible in the Visual Studio designer. Notice that the Border can nest just one child element, so if you want to add multiple visual elements, you need to encapsulate them within a container such the Grid or StackPanel. Figure 32.1 shows the result of the preceding code.

Figure 32.1 Drawing a border.

image

Specifying Different Brushes

In the preceding code the BorderBrush is assigned with a SolidColorBrush (Red), but according to the hierarchical logic of XAML, you could set it with a different brush such as LinearGradientBrush.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.19.63.106