Finally Microsoft has included the Ribbon control in Windows Presentation Foundation, similar to the Microsoft Office Ribbon Bar, all the basic features and functionality including tabs, groups, controls, Quick Access Toolbar, integration with the Windows Title Bar, and resizing with dynamic layout; everything.
Ribbon Function and Feature
- Automatic Resizing and Minimization
- Application Menu, Recent Documents Menu
- Quick Access Toolbar
- Nested Controls
- Screen Tips
- Styling and Appearance
- Commands Support
- Localization Support
- Enhanced Routed Events Framework
- WPF Code Compatibility
- Similar to Office 2010 Interface and function
All features of the Ribbon with a WPF Window

Visual structure of Ribbon

Application Menu : Every ribbon includes an Application Menu as the first tab in the ribbon, we kept some commands and application function setting utility command.

Quick Access Toolbar: The Quick Access toolbar is a very useful tool, we can keep here quick access setting command like undo, save etc.

Application Title : In the Application title section, we define the title of the application.
Ribbon Group: This is a very useful container, we use it for categories of related content or to collect related navigation links in a group. We can also keep data in a collection.

Ribbon Button: The Ribbon button functionally works nearly similarly the same as a normal WPF button. This is for ing an event and communicating with business logic. It is responsible for providing an interface for the actions exposed by your application.

Help Icon : The help button is located always on the right side of the Ribbon bar.

Ribbon Tab

Step-by-step Ribbon creates one Ribbon sample Example.
Step 1: Open Visual Studio 12, then create a new WPF Project.

Step 2: Add a Ribbon Bar Reference to right-click on the Project Solution Explorer then select "Add reference" and search for the system.windows.controls.ribbon dll.

Step 3: Add the ribbon control to the code window.

- <Window x:Class=" RibbonBar.MainWindow "
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- Title="MainWindow" Height="350" Width="525">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition/>
- </Grid.RowDefinitions>
- <Ribbon x:Name="RibbonWin" SelectedIndex="0">
- </Ribbon>
- </Grid>
- </Window>

- <Window x:Class=" RibbonBar.MainWindow "
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- Title="MainWindow" Height="350" Width="525">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition/>
- </Grid.RowDefinitions>
- <Ribbon x:Name="RibbonWin" SelectedIndex="0">
- <!-- Help Pane, located at the right-hand side -->
- <Ribbon.HelpPaneContent>
- <RibbonButton SmallImageSource="Images\help.png" />
- </Ribbon.HelpPaneContent>
- <!-- Quick Access Toolbar - located at the upper-left corner -->
- <Ribbon.QuickAccessToolBar>
- <RibbonQuickAccessToolBar>
- <RibbonButton x:Name ="Save" SmallImageSource="Images\save.png" />
- <RibbonSplitButton x:Name ="Undo" SmallImageSource="Images\undo.png">
- <RibbonSplitMenuItem Header="Undo 1" />
- <RibbonSplitMenuItem Header="Undo 2" />
- <RibbonSplitMenuItem Header="Undo 3" />
- </RibbonSplitButton>
- <RibbonSplitButton x:Name="Redo" SmallImageSource="Images\redo.png" >
- <RibbonSplitMenuItem Header="Redo 1" />
- <RibbonSplitMenuItem Header="Redo 2" />
- </RibbonSplitButton>
- </RibbonQuickAccessToolBar>
- </Ribbon.QuickAccessToolBar>
- <!-- Application Menu, located at the left-hand side (down arrow) -->
- <Ribbon.ApplicationMenu>
- <RibbonApplicationMenu KeyTip="F">
- <RibbonApplicationMenuItem Header="Options" ImageSource="Images\options.png" />
- <RibbonApplicationMenuItem Header="Exit" ImageSource="Images\quit.png" />
- </RibbonApplicationMenu>
- </Ribbon.ApplicationMenu>
- <!-- Ribbon Tab #1: Home -->
- <RibbonTab Header="Home" KeyTip="H" >
- <!-- Home group-->
- <RibbonGroup x:Name="ClipboardGroup" Header="Home">
- <RibbonMenuButton LargeImageSource="Images\paste.png" Label="Paste" KeyTip="V">
- <RibbonMenuItem ImageSource="Images\paste.png" Header="Keep Text Only" KeyTip="T"/>
- <RibbonMenuItem ImageSource="Images\paste.png" Header="Paste Special..." KeyTip="S"/>
- </RibbonMenuButton>
- <RibbonButton SmallImageSource="Images\cut.png" Label="Cut" KeyTip="X" />
- <RibbonButton SmallImageSource="Images\copy.png" Label="Copy" KeyTip="C" />
- <RibbonButton SmallImageSource="Images\format_painter.png" Label="Format Painter" KeyTip="FP" />
- </RibbonGroup>
- <!-- Employee And Payroll group-->
- <RibbonGroup x:Name="Employee" Header="Employee And Payroll">
- <RibbonMenuButton LargeImageSource="Images\personal.png" Label="Employee" KeyTip="V">
- <RibbonMenuItem ImageSource="Images\paste.png" Header="Keep Text Only" KeyTip="T"/>
- <RibbonMenuItem ImageSource="Images\paste.png" Header="Paste Special..." KeyTip="S"/>
- </RibbonMenuButton>
- <RibbonButton SmallImageSource="Images\save.png" Label="Save" KeyTip="X" />
- <RibbonButton SmallImageSource="Images\add.png" Label="Add" KeyTip="C" />
- </RibbonGroup>
- </RibbonTab>
- <!-- Ribbon Tab #2: -->
- <RibbonTab Header="Insert" KeyTip="I">
- </RibbonTab>
- <!-- Ribbon Tab #3: -->
- <RibbonTab Header="PageLayout" KeyTip="L">
- </RibbonTab>
- </Ribbon>
- </Grid>
- </Window>

To add a ribbon window change some code to only the previous code as in the following 4 steps.

- Add using System.Windows.Controls.Ribbon.
- Inherit RibbonWindow.
- Use RibbonWindow instead of Window.
- Use </RibbonWindow> instead of </Window>.


Rehman ShahidPosted Aug 21, 2018, 3:54 AM
Very nice article....Thanks for sharing...(y)
Mohamad NaPosted Nov 4, 2016, 4:59 PM
Thank u very much, this is very good
SubashPosted Sep 30, 2016, 2:41 AM
But how we add separator in split buttons
SubashPosted Sep 30, 2016, 2:41 AM
Nice it working
idin kalantariPosted Dec 18, 2015, 5:47 AM
how can I use commands?
idin kalantariPosted Dec 18, 2015, 5:46 AM
very nice.....thank U,,,
Sujeet SumanPosted Sep 22, 2015, 11:43 AM
Nice Article..............
CeebLaj ThojPosted Aug 25, 2015, 6:27 AM
Download link is dead
Murtaza JafferyPosted Aug 4, 2015, 4:28 PM
Is there no designer support for this control from the toolbox?
Upendra Pratap ShahiPosted May 29, 2015, 1:57 AM
nice sir..
Burak SeyhanPosted Feb 10, 2015, 10:40 AM
How can I added please explain ?
Sandeep Singh ShekhawatPosted Aug 22, 2014, 5:41 AM
Super Article. I have implemented it in my first live project and design looking super. Thanks for sharing this. You save my some hours.
Divya SharmaPosted Aug 22, 2014, 3:25 AM
Nice article sir.. :-)
Jaroslav MitrovicPosted Aug 7, 2014, 1:45 PM
Many thanks for this Article, it is realy good. The Issue with the Offset is based on the WindowsChrome settings. The issue is not solved till now. <WindowChrome GlassFrameThickness="-1" NonClientFrameEdges="Left,Right,Bottom" /> Also more inside the Template has to be done, to reflect on different WindowStates aka max normal. And if someone find the Apllication Meneu outside the left border, change the Tablet input settings of Windows to "left hand".
Zeeshan AnwerPosted May 30, 2014, 6:59 AM
how to use password value key in ribbon controls
K VPosted May 21, 2014, 3:43 AM
Hello, Why can i not open the project
Iraklis MarkelisPosted Apr 6, 2014, 11:51 AM
Great work! Thank you very much for the help.
BMUFARIS BMUFARISPosted Apr 2, 2014, 3:53 PM
is it work for vb 2008 ?
RaviPosted Feb 25, 2014, 4:10 AM
I assigned "KeyTip" property to ribbon button (KeyTip = "CTRL N") but it is not working.
Magnus S PetersenPosted Apr 9, 2013, 11:06 AM
Very fine and instructive How can one add Ribbon controls to the ToolBox alongsidev "All WPF controls" and "Common WPF controls" ? I am using Visual Studio 2012 Professional and .Net 4.5 Regards MSP
Vishnujeet KumarPosted Jan 14, 2013, 4:47 AM
Yes sir it’s part of Visual Studio 2012, if we want to use with Visual Studio 2010 then separate download required . it’s available on this link . http://www.microsoft.com/en-us/download/details.aspx?id=11877
Mahesh ChandPosted Jan 14, 2013, 3:26 AM
Great. Is this a separate download or part of Visual Studio 2012?I know Visual Studio 2012 supports .NET 4.5.
Vishnujeet KumarPosted Jan 14, 2013, 12:01 AM
Thanks Mahesh sir ,I am using wpf 4.5 dll system.windows.controls.ribbon. I will change that image..
Mahesh ChandPosted Jan 13, 2013, 11:17 AM
Good article Vishnujeet. However, in your Add Reference you are showing you adding Telerik DLLs. Is this a Telerik control or WPF 4.5?
Vishnujeet KumarPosted Jan 13, 2013, 12:45 AM
Thanks Dinesh Sir..
Dinesh BeniwalPosted Jan 12, 2013, 10:20 PM
Great work, Welcome to the C# Corner Vishnujeet.