《WPF窗口布局面板》
一、 布局面板类型
1. 泊靠式面板
特点:内部元素可以选择泊靠的方向(上下左右)
2. 栈式面板
特点:可将包含的元素在水平或垂直方向排成一条线,当移除一个元素后,后面的元素会自动向前填充空缺。
3. 自动折行面板
内部元素在排满一行后能够自动折行
4. Grid(网格布局)
特点:可以定义任意数量的行和列,非常灵活。行的高度和列的宽度可以使用绝对值、相对比例或自动调整或设置自己纵横跨多少行的方式进行精确设定,并可以设置最大和最小值
5. 其它面板
其它面板有:画布等等
二、 各面板的代码
<Window x:Class="布局面板.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:l