WPF窗口标题栏上的菜单

时间:2013-08-05 06:48:44

标签: wpf menu window devexpress

如何在WPF窗口标题栏上显示DevExpress菜单,如下所示?

Menu displayed on window title bar

现在,我将主菜单停靠在窗口顶部,但我想将其移动到窗口的标题栏

<dxb:BarManager CreateStandardLayout="True">
    <dxb:BarManager.Bars>
        <dxb:Bar IsMainMenu="True" UseWholeRow="True">
              <dxb:Bar.DockInfo>
                   <dxb:BarDockInfo ContainerType="Top" />
              </dxb:Bar.DockInfo>
        </dxb:Bar>
    </dxb:BarManager.Bars>
</dxb:BarManager>

1 个答案:

答案 0 :(得分:0)

    <Window x:Class="WpfApplication11.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
              xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/core"
              xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
 WindowStyle="None"             
              Title="MainWindow" Height="350" Width="525">
    <Grid>
        <dxb:BarManager CreateStandardLayout="True">
            <dxb:BarManager.Items>
                <dxb:BarButtonItem x:Name="barButtonItem1" Content="test"/>
                <dxb:BarButtonItem x:Name="barButtonItem2" Content="test2"/>
            </dxb:BarManager.Items>
            <dxb:BarManager.Bars>
                <dxb:Bar IsMainMenu="True" Caption="test1">
                    <dxb:Bar.DockInfo>
                        <dxb:BarDockInfo ContainerType="Top" />
                    </dxb:Bar.DockInfo>
                    <dxb:BarButtonItemLink BarItemName="barButtonItem1"/>
                    <dxb:BarButtonItemLink BarItemName="barButtonItem2"/>
                </dxb:Bar>
            </dxb:BarManager.Bars>
        </dxb:BarManager>
    </Grid>
</Window>