示例#1
0
        private 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
        private 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);
        }