/// <summary> /// When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate />. /// </summary> public override void OnApplyTemplate() { base.OnApplyTemplate(); this.schedulerTimePicker = (SchedulerTimePicker)this.Template.FindName(TimePickerControlName, this); this.datePicker = (RadDatePicker)this.Template.FindName(DatePickerControlName, this); this.datePicker.SelectionChanged += this.OnDatePickerSelectionChanged; this.schedulerTimePicker.SelectedTimeChanged += this.OnTimePickerSelectedTimeChanged; var window = this.GetParent <RadWindow>(); if (this.datePicker != null && window != null) { this.datePicker.Culture = LocalizationManager.DefaultCulture; StyleManager.SetThemeFromParent(this.datePicker, window); } if (this.schedulerTimePicker != null && window != null) { StyleManager.SetThemeFromParent(this.schedulerTimePicker, window); } this.UpdateSelection(); }
/// <summary> /// Search for template parts and initialize them. /// </summary> public override void OnApplyTemplate() { base.OnApplyTemplate(); this.combo = this.GetTemplateChild(ComboBoxName) as RadComboBox; var window = this.GetParent <RadWindow>(); if (this.combo != null && window != null) { StyleManager.SetThemeFromParent(this.combo, window); this.combo.ApplyTemplate(); var textBox = this.combo.Template.FindName("PART_EditableTextBox", this.combo) as TextBox; if (textBox != null) { textBox.LostFocus -= this.OnEditableTextBoxLostFocus; textBox.LostFocus += this.OnEditableTextBoxLostFocus; } } this.RebindCombo(); }
/// <summary> /// Resets the theme. /// </summary> public void ResetTheme() { StyleManager.SetTheme(this.popupWindow, StyleManager.GetTheme(this)); StyleManager.SetTheme(this.dialogWindow, StyleManager.GetTheme(this)); }
/// <summary> /// Raises the <see cref="E:System.Windows.FrameworkElement.Initialized"/> event. /// This method is invoked whenever <see cref="P:System.Windows.FrameworkElement.IsInitialized"/> is set to true internally. /// </summary> /// <param name="e">The <see cref="T:System.Windows.RoutedEventArgs"/> that contains the event data.</param> protected override void OnInitialized(EventArgs e) { base.OnInitialized(e); this.DefaultStyleKey = ThemeResourceKey.GetDefaultStyleKey(StyleManager.GetTheme(this), typeof(RadSplitButton)); }
/// <summary> /// Resets the theme. /// </summary> public void ResetTheme() { StyleManager.SetTheme(this.window, StyleManager.GetTheme(this)); }