示例#1
0
        private void TimeSelector_SelectedTimeChanged(object sender, Core.SelectedDateChangedRoutedEventArgs e)
        {
            _isInternalSet = true;
            var time = _timeSelector.SelectedTime;

            switch (Mode)
            {
            case DateTimePickerMode.Time:
                SelectedDateTime = new DateTime(1, 1, 1, time.Hour, time.Minute, time.Second);
                break;

            case DateTimePickerMode.DateTime:
                if (_calendarX.SelectedDate == null)
                {
                    SelectedDateTime = null;
                }
                else
                {
                    var date = (DateTime)_calendarX.SelectedDate;
                    SelectedDateTime = new DateTime(date.Year, date.Month, date.Day, time.Hour, time.Minute, time.Second);
                }
                break;
            }

            _isInternalSet = false;
        }
示例#2
0
 private void CalendarX_SelectedDateChanged(object sender, Core.SelectedDateChangedRoutedEventArgs e)
 {
     _isInternalSet = true;
     if (_calendarX.SelectedDate == null)
     {
         SelectedDateTime = null;
     }
     else
     {
         var date = (DateTime)_calendarX.SelectedDate;
         var time = _timeSelector.SelectedTime;
         SelectedDateTime = new DateTime(date.Year, date.Month, date.Day, time.Hour, time.Minute, time.Second);
     }
     LimitTimeSelectorTime();
     _isInternalSet = false;
 }