コード例 #1
0
        // Applies current C1Theme to the controls
        void IThemeable.ThemeChanged()
        {
            _updating = true;
            LockWindowUpdate(Handle);

            ribbonToggleLight.Pressed = SampleHelper.Instance.Theme == "Material";
            C1MaterialThemeSettings settings = Helper.C1Theme.GetSettings() as C1MaterialThemeSettings;

            if (settings != null)
            {
                ribbonColorPicker1.DefaultColor = ribbonColorPicker1.Color = settings.PrimaryColor;
                ribbonColorPicker2.DefaultColor = ribbonColorPicker2.Color = settings.SecondaryColor;
            }
            C1ThemeController.ApplyThemeToControlTree(this, Helper.C1Theme);

            ((IThemeable)_appThemePanel).ThemeChanged();
            ((IThemeable)_appRibbonPanel).ThemeChanged();
            ((IThemeable)flexChart1).ThemeChanged();
            ((IThemeable)flexChart2).ThemeChanged();
            ((IThemeable)c1FlexGrid1).ThemeChanged();
            ((IThemeable)formDemo1).ThemeChanged();
            ((IThemeable)_about)?.ThemeChanged();

            LockWindowUpdate(IntPtr.Zero);
            _updating = false;
        }
コード例 #2
0
        void IThemeable.ThemeChanged()
        {
            C1MaterialThemeSettings settings = SampleHelper.Instance.C1Theme.GetSettings() as C1MaterialThemeSettings;

            if (settings != null)
            {
                Series[0].Style.StrokeColor = settings.SecondaryColor;
            }
        }
コード例 #3
0
        void IThemeable.ThemeChanged()
        {
            label1.Font   = label2.Font = label3.Font = label4.Font = label5.Font = label6.Font = new Font(Font.FontFamily, Font.Size - 2);
            c1Label8.Font = c1Label9.Font = new Font(Font.FontFamily, Font.Size - 4);
            _labelColor   = label1.ForeColor;
            C1MaterialThemeSettings settings = SampleHelper.Instance.C1Theme.GetSettings() as C1MaterialThemeSettings;

            if (settings != null)
            {
                _selectedLabelColor = settings.PrimaryColor;
            }
        }
コード例 #4
0
        // sets accent color to the current Theme and applies Theme to the controls
        private void SetAccentColors(Color primary, Color secondary)
        {
            if (!_updating)
            {
                _updating = true;

                // get C1Theme
                C1Theme theme = Helper.C1Theme;
                // Create C1ThemeSettings containing the desired theme settings
                C1MaterialThemeSettings settings = new C1MaterialThemeSettings()
                {
                    PrimaryColor = primary, SecondaryColor = secondary
                };
                // Apply settings to the C1Theme
                theme.ApplySettings(settings);
                // Apply new Theme to the controls
                ((IThemeable)this).ThemeChanged();

                _updating = false;
            }
        }