2013-07-16 116 views
0

我正在使用DevExpress WPF MVVM框架。我想添加这个图像所显示的“Home”选项卡上方的按钮。这怎么可能? enter image description here如何将按钮添加到DevExpress RibbonControl?

<dxb:BarManager> 
    <dxb:BarManager.Items> 
     <dxb:BarButtonItem x:Name="barButtonItem1" Content="About" Glyph="pack://application:,,,/DevExpress.Images.v13.1;component/Images/Support/Info_16x16.png" LargeGlyph="pack://application:,,,/DevExpress.Images.v13.1;component/Images/Support/Info_32x32.png" Command="{Binding ShowAboutCommand}"/> 
     <dxb:BarButtonItem x:Name="barButtonItem2" Content="New" /> 
     <dxb:BarButtonItem x:Name="SaveCommandBarButtonItem" Content="Save" /> 
    </dxb:BarManager.Items> 
...    

回答

0

你愿意做的不是加按钮什么,但页面

采取下面这个链接看看:

http://documentation.devexpress.com/#wpf/CustomDocument7954


编辑因发表评论

即 “区域” 要添加按钮被称为页眉在一个丝带。

这下面的链接介绍如何,但它们有:

http://documentation.devexpress.com/#wpf/CustomDocument8186

我不知道什么施胶/定位功能,你将有虽然(考虑到你在你的图像意图的准确布局)。

+0

不,我不想添加页面,我只是想在那里添加按钮 –

0

您不能在RibbonControl的任何位置添加按钮,因为RibbonControl不打算以这种方式使用。您应该使用合并到groupspages中的ribbon item links(按钮,子菜单,就地编辑器,画廊等)。请查阅RibbonControl Concepts文章以获取更多信息。
相关例子:How to create a Ribbon Control

如果你想在RibbonControl(页头区域)的右边缘添加项目,你可以使用How to add commands to the Page Header Region文章中介绍的方法。

如果要将项目添加到RibbonControl(Quick Access Toolbar)的顶部边缘,可以使用How to add items to the Quick Access Toolbar文章中描述的方法。

P.S.我看到你正在使用MVVM框架。因此,您还应该查看以下文章:MVVM Framework Getting Started (Lesson 2) - Customize a Ribbon and Create an About Button