Theming / Applying Themes to Controls / Applying Themes to MS Ribbon Control
Applying Themes to MS Ribbon Control

You can also apply themes to your standard Microsoft Ribbon control for WPF by using C1.WPF.Theming.Ribbon. The following steps illustrate applying themes to the MS Ribbon control.

  1. Add following namespace in the xaml file and create application to add MS Ribbon control.

    XAML
    Copy Code
    xmlns:ribbon="clr-namespace:System.Windows.Controls.Ribbon;assembly=System.Windows.Controls.Ribbon"
    

  2. Add following code to apply themes to ribbon control.

    Visual Basic
    Copy Code
    Private Sub ApplyTheme(name As String)
                 Dim theme As C1Theme = Nothing
                 Dim ribbonTheme As C1Theme = Nothing
                Select Case name
                     Case "Cosmopolitan"
                        ribbonTheme = New C1.WPF.Theming.Ribbon.C1ThemeRibbonCosmopolitan()
                         Exit Select
                     Case "Cosmopolitan Dark"
                        ribbonTheme = New C1.WPF.Theming.Ribbon.C1ThemeRibbonCosmopolitanDark()
                         Exit Select
                     Case "Office2013 White"
                        ribbonTheme = New C1.WPF.Theming.Ribbon.C1ThemeRibbonOffice2013White()
                         Exit Select
                     Case "Office2013 LightGray"
                        ribbonTheme = New C1.WPF.Theming.Ribbon.C1ThemeRibbonOffice2013LightGray()
                         Exit Select
                     Case "Office2013 DarkGray"
                        ribbonTheme = New C1.WPF.Theming.Ribbon.C1ThemeRibbonOffice2013DarkGray()
                     Case Else
                         Exit Select
                 End Select
                 'apply  ribbon theme
                 ribbonTheme.Apply(ribbon)
             End Sub