# Applying Themes to MS Ribbon Control

## Content



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.<br /><br />
    
    ```xml
    xmlns:ribbon="clr-namespace:System.Windows.Controls.Ribbon;assembly=System.Windows.Controls.Ribbon"
    ```
    
    <br />
2.  Add following code to apply themes to ribbon control.<br /><br />**Visual Basic**
    
    ```vbnet
    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
    ```
    
    **csharp**
    
    ```csharp
    private void ApplyTheme(string name)
    {
        C1Theme ribbonTheme = null;
        switch (name)
        {
            case "Cosmopolitan":
                ribbonTheme = new C1.WPF.Theming.Ribbon.C1ThemeRibbonCosmopolitan();
                break;
            case "Cosmopolitan Dark":
                ribbonTheme = new C1.WPF.Theming.Ribbon.C1ThemeRibbonCosmopolitanDark();
                break;
            case "Office2013 White":
                ribbonTheme = new C1.WPF.Theming.Ribbon.C1ThemeRibbonOffice2013White();
                break;
            case "Office2013 LightGray":
                ribbonTheme = new C1.WPF.Theming.Ribbon.C1ThemeRibbonOffice2013LightGray();
                break;
            case "Office2013 DarkGray":
                ribbonTheme = new C1.WPF.Theming.Ribbon.C1ThemeRibbonOffice2013DarkGray();
                break;
            default:
                break;
        }
    // apply  ribbon theme
        ribbonTheme.Apply(ribbon);
    }
    ```