Пример #1
0
        static void selectedDateChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {
            PersianDatePicker pdp = o as PersianDatePicker;

            pdp.Text = e.NewValue.ToString();
            pdp.RaiseEvent(new RoutedEventArgs(SelectedDateChangedEvent, pdp));
        }
Пример #2
0
        static object coerceDateToBeInRange(DependencyObject d, object o)
        {
            PersianDatePicker pdp   = d as PersianDatePicker;
            PersianDate       value = (PersianDate)o;

            if (value < pdp.DisplayDateStart)
            {
                return(pdp.DisplayDateStart);
            }
            if (value > pdp.DisplayDateEnd)
            {
                return(pdp.DisplayDateEnd);
            }
            return(o);
        }