2

如何使功能区控件快速访问工具栏位于我的 GUI 顶部?

在此处输入图像描述

所以我需要快速访问工具栏出现在顶部,就像它在 Word 和 Outlook 等 Windows 应用程序中一样。

编辑:这是我在其他人反馈后的最新代码:

<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>
4

1 回答 1

4

使用 RibbonWindow,您可以查看以下链接:

http://blogs.msdn.com/b/wpf/archive/2010/08/04/why-should-i-use-a-ribbonwindow.aspx

另请阅读:

http://www.shujaat.net/2012/10/ribbon-quick-access-toolbar.html

色带样品

于 2013-09-18T10:09:09.550 回答