@inherits DataFilterBaseComponent @using System.Windows.Forms
@switch (Control.Format) { case DateTimePickerFormat.Short: break; case DateTimePickerFormat.Time: break; default: break; }
@code { private DateTime DateValue { get { return Control.Value; } set { DateTime oldValue = Control.Value; DateTime newDateTime = new DateTime( value.Year, value.Month, value.Day, oldValue.Hour, oldValue.Minute, oldValue.Second, oldValue.Kind); Control.Value = newDateTime; DateTimePickerChange(); } } private DateTime TimeValue { get { return Control.Value; } set { DateTime oldValue = Control.Value; DateTime newDateTime = new DateTime( oldValue.Year, oldValue.Month, oldValue.Day, value.Hour, value.Minute, value.Second, oldValue.Kind); Control.Value = newDateTime; DateTimePickerChange(); } } private void DateTimePickerChange() { Control.OnValueChanged(null); Refresh(); } private string GetDateTimePickerDivStyle => $"{GetControlPosition()} display:inline-flex"; private string GetDateTimePickerStyle => $"{GetControlFont()} {GetBackColor()}"; }