github编辑

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.

<Panel Height="300" Width="300">
    <Rectangle Fill="Red" Height="100" VerticalAlignment="Top"/>
    <Rectangle Fill="Blue" Width="100" HorizontalAlignment="Right" />
    <Rectangle Fill="Green" Height="100" VerticalAlignment="Bottom"/>
    <Rectangle Fill="Orange" Width="100" HorizontalAlignment="Left"/>
</Panel>

There are other more useful panels that derive from Panel, these include:

StackPanelchevron-rightDockPanelchevron-rightRelativePanelchevron-rightWrapPanelchevron-right

Reference

Panelarrow-up-right

Source code

Panel.csarrow-up-right

面板概述chevron-right创建自定义面板chevron-right

最后更新于

这有帮助吗?