Browse Source
Add Clear function to Date and Time pickers. (#13082)
* feat: add Clear function to Date and Time pickers.
* feat: update comment wording.
---------
Co-authored-by: rabbitism <dongbin@irihi.tech>
revert-13066-fixes/13064-logical-scrollable
Dong Bin
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
24 additions and
0 deletions
-
src/Avalonia.Controls/CalendarDatePicker/CalendarDatePicker.cs
-
src/Avalonia.Controls/DateTimePickers/DatePicker.cs
-
src/Avalonia.Controls/DateTimePickers/TimePicker.cs
|
|
|
@ -918,5 +918,13 @@ namespace Avalonia.Controls |
|
|
|
{ |
|
|
|
return !string.IsNullOrWhiteSpace(formatString); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Clear <see cref="SelectedDate"/>.
|
|
|
|
/// </summary>
|
|
|
|
public void Clear() |
|
|
|
{ |
|
|
|
SetCurrentValue(SelectedDateProperty, null); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -410,5 +410,13 @@ namespace Avalonia.Controls |
|
|
|
{ |
|
|
|
SelectedDateChanged?.Invoke(sender, e); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Clear <see cref="SelectedDate"/>.
|
|
|
|
/// </summary>
|
|
|
|
public void Clear() |
|
|
|
{ |
|
|
|
SetCurrentValue(SelectedDateProperty, null); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -283,5 +283,13 @@ namespace Avalonia.Controls |
|
|
|
_popup!.Close(); |
|
|
|
SetCurrentValue(SelectedTimeProperty, _presenter!.Time); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Clear <see cref="SelectedTime"/>.
|
|
|
|
/// </summary>
|
|
|
|
public void Clear() |
|
|
|
{ |
|
|
|
SetCurrentValue(SelectedTimeProperty, null); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|