ToolBarTray与ToolBarPanel的区别

ToolBarTray 类:表示处理ToolBar 的布局的容器。用于ToolBar控件模板之中。

e.g.

<ToolBarTray>

  <ToolBar>

    <Button/>

    <Button/>

  </ToolBar>

</ToolBarTray>

ToolBarPanel 类:ToolBar中排列ToolBar项。

e.g.

<Style x:key="MainToolBar" TargetType="{x:Type ToolBar}">

  <Setter Property="OverridesDefaultStyle" Value="True"/>

  <Setter Property="Template">

    <Setter.Value>

      <ControlTemplate TargetType="{x:Type ToolBar}">

        <Border>

          <ToolBarPanel IsItemHost="True" />

        </Border>

      </ControlTemplate>

    </Setter.Value>

  </Setter>

</Style>

posted @ 2015-09-28 12:55  chikenonachain  阅读(3239)  评论(1编辑  收藏  举报