ComponentOne GanttView for WPF
Apply Themes
Features > Style and Appearance > Apply Themes

GanttView supports built-in ComponentOne themes available in C1.WPF.Theming library. You can apply any of the available C1 themes to the GanttView control and provide a customized and consistent appearance to the application. To understand how themes can be used effectively, see Theming.

The following image shows a GanttView with C1WhistlerBlue theme applied to it.

The following steps illustrate how to apply C1 themes to GanttView. This example uses the sample created in the Quick start.

  1. Create a Quick start application and add the following .dll files to your application.
    • C1.WPF.Theming
    • C1.WPF.Theming.WhistlerBlue
  2. Switch to the MainWindow.xaml.cs file and add the following import statements.
    Imports C1.WPF.Theming
    Imports C1.WPF.Theming.WhistlerBlue
    
    using C1.WPF.Theming;
    using C1.WPF.Theming.WhistlerBlue;
    
  3. Create a class, MyTheme, to create an object of the C1Themes class.
    Public Class MyThemes
        Private Shared _myTheme As C1Theme = Nothing
        Public Shared ReadOnly Property MyTheme() As C1Theme
            Get
                If _myTheme Is Nothing Then
                    _myTheme = New C1ThemeWhistlerBlue()
                End If
    
                Return _myTheme
            End Get
        End Property
    End Class
    
    public class MyThemes
    {
        private static C1Theme _myTheme = null;
        public static C1Theme MyTheme
        {
            get
            {
                if (_myTheme == null)
                {
                    _myTheme = new C1ThemeWhistlerBlue();
                }
    
                return _myTheme;
            }
        }
    }
    
  4. Add the following code in the loaded event to apply ComponentOne theme to the GanttView control.
    'Apply C1 theme to GanttView
    C1Theme.ApplyTheme(gv, MyThemes.MyTheme)
    
    //Apply C1 theme to GanttView 
    C1Theme.ApplyTheme(gv, MyThemes.MyTheme);