Search code examples
c#wpfvisual-studio-2012ribbon-control

How to make the ribbon control quick access toolbar be on the top of my GUI?


How to make the ribbon control quick access toolbar be on the top of my GUI?

enter image description here

So I need the quick access toolbar to appear on top as it does in windows apps such as word and outlook.

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>

Solution

  • Use a RibbonWindow, you can check the following link:

    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

    Ribbon sample