Layout
The layout of a WPF form is described by the elements it contains. Several controls are dedicated to positioning others. For example, a layout control may contain two Label
controls.
Three different layout controls are explored:
Grid
StackPanel
DockPanel
These three positioning controls can be used to create advanced layouts by specifying an absolute position for every single control by hand.
Layout controls such as those above can be nested inside one another to create more advanced interfaces.
A Grid
can be used to arrange controls in rows and columns.
Using the Grid control
A Grid
control can be added within the Window
control in the XAML document:
$xaml = '<?xml version="1.0" encoding="utf-8"?>
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid>
<Label...