From 97e339453e80608d8079505f3e90f675e5a0e3fa 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