Search code examples
wpfvisual-studio-2012ribbon

WPF Ribbon Navigation Buttons - How to use


If you create an empty WPF app, and replace the MainWindow.xaml with the following:

<ribbon:Ribbon xmlns:ribbon="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary" />

(Note the use of the Ribbon class, not RibbonWindow as is used in most tutorials on the subject.)

Then delete MainWindow.cs and run the app.

It will give you a nice looking window with IE like navigation buttons and under that, the actual ribbon bar.

Ribbon with Navigation

How do I use those navigation buttons? I have found lots of info on the rest of the Ribbon Bar, but not the navigation buttons.

I have an app with has a navigation stack and I just need to be able to fire an event when the user clicks forward/backward so I can have the app navigate. And of course, I need to be able to enable or disable them depending on the navigation stack.

I have looked, but I don't see any property of the RibbonClass that exposes the buttons.


Solution

  • Navigation buttons are part of the navigation mechanics built into WPF since its Avalon times. They have nothing in common with Ribbon.

    See details here: https://learn.microsoft.com/en-us/dotnet/framework/wpf/app-development/navigation-overview