wpf 如何使功能区控件快速访问工具栏位于我的 GUI 顶部?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18867860/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to make the ribbon control quick access toolbar be on the top of my GUI?
提问by user2381422
How to make the ribbon control quick access toolbar be on the top of my GUI?
如何使功能区控件快速访问工具栏位于我的 GUI 顶部?


So I need the quick access toolbar to appear on top as it does in windows apps such as word and outlook.
因此,我需要将快速访问工具栏显示在顶部,就像它在 Word 和 Outlook 等 Windows 应用程序中一样。
Edit: This is my newest code after feedback from other people here:
编辑:这是我在其他人反馈后的最新代码:
<r:RibbonWindow
x:Class="Company.RouteVisualization.MainWindowView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:r="clr-namespace:System.Windows.Controls.Ribbon;assembly=System.Windows.Controls.Ribbon"
Title="Route Visualization"
Height="395"
Width="832"
TextOptions.TextFormattingMode="Display"
WindowStyle="None">
<Grid>
<r:Ribbon Grid.Row="0" Name="ribbon">
<r:Ribbon.QuickAccessToolBar>
<r:RibbonQuickAccessToolBar>
<StackPanel Orientation="Horizontal">
<r:RibbonButton Label="B1" VerticalAlignment="Center"/>
<r:RibbonButton Label="B2" VerticalAlignment="Center"/>
</StackPanel>
</r:RibbonQuickAccessToolBar>
</r:Ribbon.QuickAccessToolBar>
<r:RibbonTab Header="Home">
<r:RibbonGroup Name="groupHome" Header="View">
<r:RibbonToggleButton Name="DisplayMapButton" Label="Display Map" IsChecked="True"
LargeImageSource="../Resources/Images/Earth.png"
RenderOptions.BitmapScalingMode="NearestNeighbor"/>
<r:RibbonToggleButton Name="OnlineButton" Label="Online"
LargeImageSource="../Resources/Images/Online.png"
RenderOptions.BitmapScalingMode="NearestNeighbor"/>
</r:RibbonGroup>
</r:RibbonTab>
</r:Ribbon>
</Grid>
</r:RibbonWindow>
回答by Chevul Ervin
Use a RibbonWindow, you can check the following link:
使用 RibbonWindow,您可以查看以下链接:
http://blogs.msdn.com/b/wpf/archive/2010/08/04/why-should-i-use-a-ribbonwindow.aspx
http://blogs.msdn.com/b/wpf/archive/2010/08/04/why-should-i-use-a-ribbonwindow.aspx
Also read this:
另请阅读:
http://www.shujaat.net/2012/10/ribbon-quick-access-toolbar.html
http://www.shujaat.net/2012/10/ribbon-quick-access-toolbar.html



