Inheritance: System.Windows.Controls.Control
Exemplo n.º 1
0
        protected internal static object CoerceViewDateTime(DependencyObject d, object value)
        {
            var dp = (FXDatePicker)d;

            if (value != null)
            {
                var newValue = (DateTime)value;
                return(FXMonthView.ValidateDateRange(newValue));
            }

            return(value);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Clear the event, and detach our current EditableTextBox from ComboBox
        /// </summary>
        private void DetachFromVisualTree()
        {
            if (MonthView != null)
            {
                CommandManager.RemovePreviewExecutedHandler(MonthView, OnMonthViewCommandPreviewExecuted);
                MonthView.SelectedDateTimeChanged -= OnMonthViewDateTimeSelectionChanged;
                MonthView = null;
            }

            if (ValuePresenter != null)
            {
                ValuePresenter.MouseLeftButtonDown -= OnValuePresenterDoubleClick;
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Detaches the EditableTextBox, MonthView from old child tree and attaches them to a new one
        /// </summary>
        private void AttachToVisualTree()
        {
            DetachFromVisualTree();

            MonthView      = GetTemplateChild(PART_MonthView) as FXMonthView;
            ValuePresenter = GetTemplateChild(PART_ValuePresenter) as TextBlock;

            if (MonthView != null)
            {
                CommandManager.AddPreviewExecutedHandler(MonthView, OnMonthViewCommandPreviewExecuted);
                MonthView.SelectedDateTimeChanged += OnMonthViewDateTimeSelectionChanged;
            }

            if (ValuePresenter != null)
            {
                ValuePresenter.MouseLeftButtonDown += OnValuePresenterDoubleClick;
            }

            RefreshDropDownButtonStyle();
        }
Exemplo n.º 4
0
        private static void OnViewDateTimeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            var dp = (FXDatePicker)d;

            FXMonthView.OnViewDateTimeChanged(dp.MonthView, e);
        }
 /// <summary>
 /// Initializes a new instance of the FXMonthViewAutomationPeer class.
 /// </summary>
 /// <param name="owner">Owning MonthView control</param>
 public FXMonthViewAutomationPeer(FXMonthView owner)
     : base(owner)
 {
 }