Microsoft Ribbon for WPF Released

Original author: Pete Brown
  • Transfer
I am pleased to inform you of the release of the final version of Microsoft Ribbon for WPF.



The new control is compatible with WPF 3.5 SP1 and WPF 4. It is not a wrapper over unmanaged code, but is entirely written in WPF, which means full compatibility with WPF style management capabilities.


Application template


The installer contains the new WPF Ribbon Application application template for Visual Studio.



After creating and starting a new project, you will see a blank for your tape.



Here is the XAML code for this tape:



  
    
                              x:Name="MenuItem1"
                       ImageSource="Images\LargeIcon.png"/>
    

  


              Header="Home">
                   Header="Group1">
                        LargeImageSource="Images\LargeIcon.png"
                 Label="Button1" />
                        SmallImageSource="Images\SmallIcon.png"
                 Label="Button2" />
                        SmallImageSource="Images\SmallIcon.png"
                 Label="Button3" />
                        SmallImageSource="Images\SmallIcon.png"
                 Label="Button4" />
      
    

    
  




* This source code was highlighted with Source Code Highlighter.


A window containing a ribbon inherits from the RibbonWindow class. This class allows you to work with the window's title area (which is not part of ClientArea and is not available for rendering in a regular Window - approx. Transl.) And display controls such as, for example, a quick access panel and contextual tab titles. You can not use this class, but in this case, you will not be able to work with the window title.

The new ribbon contains all the features that you expected to find in it: a quick access panel, application menus, auxiliary panels, advanced tooltips, keyboard shortcuts, automatic resizing and location, tabs, contextual tab headers, aero support, etc. P.

Context Tabs


Let's add a new tab and put it in a group of contextual tabs (such as, for example, table editing tools in Word). You need to add the following code to the XAML feed:

         ContextualTabGroupHeader="Awesome Tools"
         Header="Really Awesome">
               Header="Group2">
                    LargeImageSource="Images\LargeIcon.png"
               Label="Button21" />
  




                      Visibility="Visible"
                   Background="Green" />



* This source code was highlighted with Source Code Highlighter.




Pay attention to the changes in the window code to support the title of the context group.

Quick Access Toolbar


As you expected, the ribbon supports the quick access toolbar. XAML Code:


  
                    SmallImageSource="Images\SmallIcon.png"
               Label="ButtonQ1" />
                    SmallImageSource="Images\SmallIcon.png"
               Label="ButtonQ2" />
                    SmallImageSource="Images\SmallIcon.png"
               Label="ButtonQ3" />
  



* This source code was highlighted with Source Code Highlighter.




The screenshot shows two quick access buttons and a double arrow, indicating that a few more buttons are available.

The WPF Ribbon development team has done a great job in creating this control. It supports additional scenarios needed when using it in a wide range of tasks. There is also full support for the style of Windows 7 user interfaces. It's nice to see that WPF Ribbon is released and available for use in your projects.

PS And yes: RibbonButton supports ICommand)

References:


Also popular now: