Panel
The Panel is the base class for controls that can contain multiple children like DockPanel or StackPanel.
The Panel class can be useful on its own for very basic layouts, or simply to allow multiple controls to be to be contained.
1
<Panel Height="300" Width="300">
2
<Rectangle Fill="Red" Height="100" VerticalAlignment="Top"/>
3
<Rectangle Fill="Blue" Width="100" HorizontalAlignment="Right" />
4
<Rectangle Fill="Green" Height="100" VerticalAlignment="Bottom"/>
5
<Rectangle Fill="Orange" Width="100" HorizontalAlignment="Left"/>
6
</Panel>
Copied!
There are other more useful panels that derive from Panel, these include:

Reference

​Panel​

Source code

​Panel.cs​
Last modified 6mo ago
Export as PDF
Copy link