border:只能有一个子集,如要在内容周围显示边框,必须放在父border元素中。

属性borderbrush设置边框颜色,borderthickness设置边框宽度,cornerradius设置圆角程度(90度就是直线,0度就是圆)。

  <grid>
        <grid.rowdefinitions>
            <rowdefinition></rowdefinition>
            <rowdefinition></rowdefinition>
        </grid.rowdefinitions>
        <border background="lightblue"
                borderbrush="black"
                borderthickness="20"
                cornerradius="45"
                padding="25" 
                grid.row="0">
        </border>
        <border background="lightblue"
                borderbrush="black"
                borderthickness="20"
                cornerradius="45"
                padding="25"
                grid.row="1">
            <button content="999"></button>
        </border>
    </grid>

bulletdecorator:将项目符号与另一个可是对象对齐。bulletdecorator有两个属性:bullet、child。

bullet放的是项目符号,bullet和child都只能有一个控件。如果 child 对象是一个 textblock, bullet 始终与第一行文本对齐。如果 child 对象不是一个 textblock, bullet 则与 child 对象的中心对齐。(摘自https://lileltp.wordpress.com/2009/08/03/wpf%e4%b9%8b%e5%b8%83%e5%b1%80-bulletdecorator/)

 <grid>
        <grid.rowdefinitions>
            <rowdefinition></rowdefinition>
            <rowdefinition></rowdefinition>
        </grid.rowdefinitions>
        <bulletdecorator  grid.row="0"
                          grid.column="0"
                          margin="0,5,0,0"
                          verticalalignment="center"
                          background="yellow">
            <bulletdecorator.bullet>
                <label>备注:</label>
            </bulletdecorator.bullet>
            <!--textblock为child元素-->
            <!--textwrapping文本进行换行-->
            <textblock width="100"
                       textwrapping="wrap"
                       horizontalalignment="left"
                       foreground="purple">
     哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈
            </textblock>
        </bulletdecorator>
        <bulletdecorator  grid.row="1"
                          grid.column="0"
                          margin="0,5,0,0"
                          verticalalignment="center"
                          background="yellow">
            <bulletdecorator.bullet>
                <label>备注:</label>
            </bulletdecorator.bullet>
            <textbox text="奇葩说"></textbox>
        </bulletdecorator>
    </grid>

canvas:使用坐标绝对定位元素。子元素的大小需要设置。canvas.left指相对布局的左边偏离多少,canvas.left相对布局的上面偏离多少,同理canvas.bottem、canvas.right。

 <canvas>
        <canvas height="100"
                width="100"
                top="0"
                left="0"
                background="red"
                cursor="cross"
                >
            <textbox text="5555"></textbox>
        </canvas>
        <canvas height="100"
                width="100"
                top="100"                 
                canvas.left="100"
                background="green" />
        <canvas height="100"
                width="100"
                top="50"
                left="50"
                background="blue" />
    </canvas>

dockpanel:停靠面板,dock=”left”停靠在左边,dock=”right”停靠在右边。 lastchildfill为true,则最后一个元素填充剩下的空间。

 <dockpanel lastchildfill="false" horizontalalignment="stretch" verticalalignment="top">
        <button dockpanel.dock="left"
                content="buttonleft"></button>
        <button dockpanel.dock="top" 
                content="buttontop"></button>
        <button dockpanel.dock="right"
                content="buttonright"></button>
        <button dockpanel.dock="bottom"
                content="buttonbottom"></button>
        <button  content="lastbutton"></button>
</dockpanel>

expander:该控件显示具有可折叠内容,并可以显示标题。当expanddirection为right或left,则不应该设置width。

header可以是图片、字符串等。

<!--isexpanded表示初始状态是否叠起来-->
    <expander name="myexpander"
              background="tan"
              horizontalalignment="right"
              header="my expander"
              expanddirection="down"
              isexpanded="false"
              width="100">
        <textblock textwrapping="wrap">
    lorem ipsum dolor sit amet, consectetur
    adipisicing elit, sed do eiusmod tempor incididunt ut
    labore et dolore magna aliqua
        </textblock>
    </expander>