The Border control is a Decorator control that you can use to draw a border, a background, or even both, around another element. Since the WPF panels don’t support drawing a border around its edges, the Border control can help you achieve that. You could surround a Panel with a Border.

Below is the XAML code for this project.
1 | < Window x:Class = "BorderControl.MainWindow" |
6 | xmlns:local = "clr-namespace:BorderControl" |
8 | WindowStartupLocation = "CenterScreen" |
9 | Title = "BorderControl" Height = "250" Width = "400" > |
11 | < Border Background = "Azure" BorderBrush = "Gray" BorderThickness = "2" > |
12 | < StackPanel Margin = "10" > |
13 | < Button >Button 1</ Button > |
14 | < Button Margin = "0,10" >Button 2</ Button > |
15 | < Button >Button 3</ Button > |
In the next section we will do a little more.