コード例 #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;

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