Browse Source

Merge pull request #11057 from timunie/fix/CalendarDatePicker_Watermark

Fix Watermark not shown on CalendarDatePicker when clearing the value in code
pull/11068/head
github-merge-queue[bot] 4 years ago
committed by GitHub
parent
commit
c16ef8fc2c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/Avalonia.Controls/CalendarDatePicker/CalendarDatePicker.cs

3
src/Avalonia.Controls/CalendarDatePicker/CalendarDatePicker.cs

@ -875,10 +875,11 @@ namespace Avalonia.Controls
{ {
if (_textBox != null) if (_textBox != null)
{ {
SetCurrentValue(TextProperty, String.Empty);
if (string.IsNullOrEmpty(Watermark) && !UseFloatingWatermark) if (string.IsNullOrEmpty(Watermark) && !UseFloatingWatermark)
{ {
DateTimeFormatInfo dtfi = DateTimeHelper.GetCurrentDateFormat(); DateTimeFormatInfo dtfi = DateTimeHelper.GetCurrentDateFormat();
SetCurrentValue(TextProperty, string.Empty);
_defaultText = string.Empty; _defaultText = string.Empty;
var watermarkFormat = "<{0}>"; var watermarkFormat = "<{0}>";
string watermarkText; string watermarkText;

Loading…
Cancel
Save