This commit is contained in:
NaBian committed 2021-07-31 14:18:53 +08:00
1 parent 8813fddfac
commit a7b2d297a7
3 files changed
+31 -10

No files matched your search

@@ -367,9 +367,11 @@ namespace HandyControl.Controls
_dropDownButton.Click += DropDownButton_Click;
_dropDownButton.MouseLeave += DropDownButton_MouseLeave;
var selectedDateTime = SelectedDateTime;
if (_textBox != null)
{
if (SelectedDateTime == null)
if (selectedDateTime == null)
{
_textBox.Text = DateTime.Now.ToString(DateTimeFormat);
}
@@ -385,7 +387,7 @@ namespace HandyControl.Controls
_textBox.TextChanged += TextBox_TextChanged;
_textBox.LostFocus += TextBox_LostFocus;
if (SelectedDateTime == null)
if (selectedDateTime == null)
{
if (!string.IsNullOrEmpty(_defaultText))
{
@@ -395,12 +397,19 @@ namespace HandyControl.Controls
}
else
{
_textBox.Text = DateTimeToString(SelectedDateTime.Value);
_textBox.Text = DateTimeToString(selectedDateTime.Value);
}
}
_originalSelectedDateTime ??= DateTime.Now;
SetCurrentValue(DisplayDateTimeProperty, _originalSelectedDateTime);
if (selectedDateTime is null)
{
_originalSelectedDateTime ??= DateTime.Now;
SetCurrentValue(DisplayDateTimeProperty, _originalSelectedDateTime);
}
else
{
SetCurrentValue(DisplayDateTimeProperty, selectedDateTime);
}
}
public virtual bool VerifyData()