Exemple #1
0
        private void ApplyTheme(ToggleButton button, C1Theme theme)
        {
            if (_lastSelected != null)
            {
                _lastSelected.IsChecked = false;
            }
            _lastSelected = button;

            theme.Apply(LayoutRoot);
            LayoutRoot.Background = (Brush)C1Theme.GetCurrentThemeResources(theme)["MouseOverGradientBrush"];
        }
Exemple #2
0
        public MainWindow()
        {
            InitializeComponent();
            var theme       = new C1.WPF.Theming.Cosmopolitan.C1ThemeCosmopolitan();
            var ribbonTheme = new C1.WPF.Theming.Ribbon.C1ThemeRibbonCosmopolitan();

            ribbonTheme.Apply(this);
            root.Style = TryFindResource(typeof(Window)) as Style;
            this.Resources.MergedDictionaries.Add(C1Theme.GetCurrentThemeResources(theme));
            Application.Current.Resources.MergedDictionaries.Add(theme.GetNewResourceDictionary());
            Application.Current.Resources.MergedDictionaries.Add(ribbonTheme.GetNewResourceDictionary());
        }