Beispiel #1
0
        /// <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();
        }
Beispiel #2
0
        /// <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();
        }
Beispiel #3
0
 /// <summary>
 /// Resets the theme.
 /// </summary>
 public void ResetTheme()
 {
     StyleManager.SetTheme(this.popupWindow, StyleManager.GetTheme(this));
     StyleManager.SetTheme(this.dialogWindow, StyleManager.GetTheme(this));
 }
Beispiel #4
0
 /// <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));
 }
Beispiel #5
0
 /// <summary>
 /// Resets the theme.
 /// </summary>
 public void ResetTheme()
 {
     StyleManager.SetTheme(this.window, StyleManager.GetTheme(this));
 }