/// <summary> /// Sets the theme of the specified <see cref="DependencyObject"/>. /// </summary> /// <param name="element">The element to set the theme of.</param> /// <param name="parent">Parent that supplies the theme.</param> public static void SetThemeFromParent(DependencyObject element, DependencyObject parent) { if (element == null || parent == null) { return; } StyleManager.SetTheme(element, StyleManager.GetTheme(parent)); }
private static void SetTheme(this FrameworkElement element, Theme theme) { if (!(element is IThemable)) { SetDefautStyleKeyFromTheme(element, theme); } StyleManager.SetTheme(element, theme); }
private static void OnSchedulerChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { var window = (SchedulerWindow)d; var scheduler = e.NewValue as RadScheduler; if (scheduler != null) { Theme theme = StyleManager.GetTheme(scheduler); StyleManager.SetTheme(window.WindowWrapper.PopupWindow, theme); window.Language = XmlLanguage.GetLanguage(scheduler.GetCultureInUse().IetfLanguageTag); } }
/// <summary> /// Called when <see cref="RadSchedulerCommands.EditRecurrenceRule"/> command gets executed. /// </summary> protected virtual void OnEditRecurrenceExecuted() { var recurrenceDialogWindow = new RecurrenceDialogWindow(this.Scheduler); recurrenceDialogWindow.ParentDialogWindow = this; StyleManager.SetTheme((recurrenceDialogWindow as DialogWindow), StyleManager.GetTheme(this.Scheduler as RadScheduler)); (recurrenceDialogWindow as DialogWindow).IsModal = this.IsModal; recurrenceDialogWindow.Appointment = this.EditedAppointment; recurrenceDialogWindow.RecurrenceRuleSaved += this.OnRecurrenceRuleSaved; recurrenceDialogWindow.Closed += OnRecurrenceDialogWindowClosed; recurrenceDialogWindow.Show(); }
/// <summary> /// Resets the theme. /// </summary> public void ResetTheme() { StyleManager.SetTheme(this.popupWindow, StyleManager.GetTheme(this)); StyleManager.SetTheme(this.dialogWindow, StyleManager.GetTheme(this)); }
/// <summary> /// Resets the theme. /// </summary> public void ResetTheme() { StyleManager.SetTheme(this.window, StyleManager.GetTheme(this)); }