From 464e85e78c0805e023bed258fe1bce4b0104ea73 Mon Sep 17 00:00:00 2001 From: punker76 Date: Sun, 10 Nov 2024 14:19:12 +0100 Subject: [PATCH] fix: use CustomDateFormatString also for watermark --- .../CalendarDatePicker/CalendarDatePicker.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Avalonia.Controls/CalendarDatePicker/CalendarDatePicker.cs b/src/Avalonia.Controls/CalendarDatePicker/CalendarDatePicker.cs index 85f035a604f..d06416df4ae 100644 --- a/src/Avalonia.Controls/CalendarDatePicker/CalendarDatePicker.cs +++ b/src/Avalonia.Controls/CalendarDatePicker/CalendarDatePicker.cs @@ -901,6 +901,11 @@ private void SetWaterMarkText() switch (SelectedDateFormat) { + case CalendarDatePickerFormat.Custom: + { + watermarkText = string.Format(CultureInfo.CurrentCulture, watermarkFormat, CustomDateFormatString); + break; + } case CalendarDatePickerFormat.Long: { watermarkText = string.Format(CultureInfo.CurrentCulture, watermarkFormat, dtfi.LongDatePattern.ToString()); @@ -913,6 +918,7 @@ private void SetWaterMarkText() break; } } + _textBox.Watermark = watermarkText; } else