//---------------------------------------- #region ** Settings private void themeList_SelectionChanged(object sender, C1.WPF.SelectionChangedEventArgs <int> e) { if (themeList.SelectedItem == null) { return; } themeDropDown.IsDropDownOpen = false; scheduler.BeginUpdate(); C1Theme theme = null; switch (themeList.SelectedItem.ToString()) { case "Black": theme = new C1.WPF.Theming.Office2016.C1ThemeOffice2016Black(); break; case "White": theme = new C1.WPF.Theming.Office2016.C1ThemeOffice2016White(); break; case "Colorful": theme = new C1.WPF.Theming.Office2016.C1ThemeOffice2016Colorful(); break; case "Dark Gray": theme = new C1.WPF.Theming.Office2016.C1ThemeOffice2016DarkGray(); break; } C1Theme.ApplyTheme(this, theme); var rd = theme.GetNewResourceDictionary(); scheduler.Theme = calendar.Theme = rd; // apply themed FlexGrid style to inherited controls var flexGridStyle = rd[typeof(C1.WPF.FlexGrid.C1FlexGrid)] as Style; if (flexGridStyle != null) { agendaView.Style = flexGridStyle; tableView.Style = flexGridStyle; } var adornerLayer = AdornerLayer.GetAdornerLayer(this); if (adornerLayer != null) { // this will aplly theme to everything displayed in adorner, including any C1Window instances C1Theme.ApplyTheme(adornerLayer, theme); } // scheduler_LayoutUpdated(null, null); scheduler.EndUpdate(); }
private void agendaRange_SelectionChanged(object sender, C1.WPF.SelectionChangedEventArgs <int> e) { if (agendaRange.SelectedItem != null && agendaView != null) { switch (agendaRange.SelectedItem.ToString()) { case "Today": this.agendaView.ViewType = AgendaViewType.Today; break; case "Week": this.agendaView.ViewType = AgendaViewType.Week; break; default: this.agendaView.ViewType = AgendaViewType.DateRange; break; } agendaDropDown.IsDropDownOpen = false; } }