WPF comes with the following five built-in panels:
- Canvas
- DockPanel
- Grid
- StackPanel
- WrapPanel
The purpose and use of these panels is different. Each panel has a different way to position and reposition child controls placed within that panel. The following articles in this series will summarise these panels and their usages.
Similar to any other WPF control, a Panel control may be represented in two ways. First, at design-time using XAML elements and attributes, and second, at run-time, using a WPF class and its properties.
The code snippet in Listing 2 creates a Grid panel at design-time using XAML.
Listing 2 generates Figure 2.