From f3f59bd5b20b856d25b1c9ea480c1cf2278ba124 Mon Sep 17 00:00:00 2001 From: Dong Bin <14807942+rabbitism@users.noreply.github.com> Date: Mon, 9 Feb 2026 15:00:07 +0800 Subject: [PATCH] Implement PlaceholderText (#727) * feat: replace Watermark with PlaceholderText in AutoCompleteBox and related controls * fix: remove duplicate PlaceholderForeground setter. --- .../Pages/AutoCompleteBoxDemo.axaml | 14 +++++++------- .../Pages/NumericUpDownDemo.axaml | 6 +++--- demo/Semi.Avalonia.Demo/Pages/TextBoxDemo.axaml | 14 +++++++------- src/Semi.Avalonia/Controls/AutoCompleteBox.axaml | 9 ++++++--- .../Controls/CalendarDatePicker.axaml | 6 ++++-- src/Semi.Avalonia/Controls/ComboBox.axaml | 2 +- .../Controls/ManagedFileChooser.axaml | 2 +- src/Semi.Avalonia/Controls/NumericUpDown.axaml | 4 +++- src/Semi.Avalonia/Controls/TextBox.axaml | 13 +++++++++---- src/Semi.Avalonia/Themes/Dark/TextBox.axaml | 1 + .../Themes/HighContrast/TextBox.axaml | 1 + src/Semi.Avalonia/Themes/Light/TextBox.axaml | 1 + 12 files changed, 44 insertions(+), 29 deletions(-) diff --git a/demo/Semi.Avalonia.Demo/Pages/AutoCompleteBoxDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/AutoCompleteBoxDemo.axaml index 614efa4..f2afbb7 100644 --- a/demo/Semi.Avalonia.Demo/Pages/AutoCompleteBoxDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/AutoCompleteBoxDemo.axaml @@ -28,7 +28,7 @@ @@ -69,12 +69,12 @@ diff --git a/demo/Semi.Avalonia.Demo/Pages/TextBoxDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/TextBoxDemo.axaml index 2ba6d0b..5fc0ae7 100644 --- a/demo/Semi.Avalonia.Demo/Pages/TextBoxDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/TextBoxDemo.axaml @@ -23,36 +23,36 @@ + PlaceholderText="Large" /> + PlaceholderText="Default" /> + PlaceholderText="Small" /> + PlaceholderText="Disabled" /> + PlaceholderText="Bordered" /> - + diff --git a/src/Semi.Avalonia/Controls/AutoCompleteBox.axaml b/src/Semi.Avalonia/Controls/AutoCompleteBox.axaml index 3d0411c..391be3d 100644 --- a/src/Semi.Avalonia/Controls/AutoCompleteBox.axaml +++ b/src/Semi.Avalonia/Controls/AutoCompleteBox.axaml @@ -4,11 +4,12 @@ - + + @@ -23,7 +24,8 @@ Theme="{DynamicResource NonErrorTextBox}" InnerLeftContent="{TemplateBinding InnerLeftContent}" InnerRightContent="{TemplateBinding InnerRightContent}" - Watermark="{TemplateBinding Watermark}" /> + PlaceholderForeground="{TemplateBinding PlaceholderForeground}" + PlaceholderText="{TemplateBinding PlaceholderText}" /> + PlaceholderForeground="{TemplateBinding PlaceholderForeground}" + PlaceholderText="{TemplateBinding PlaceholderText}" /> + @@ -52,8 +53,9 @@ CornerRadius="{TemplateBinding CornerRadius}" Foreground="{TemplateBinding Foreground}" Theme="{DynamicResource NonErrorTextBox}" - UseFloatingWatermark="{TemplateBinding UseFloatingWatermark}" - Watermark="{TemplateBinding Watermark}"> + UseFloatingPlaceholder="{TemplateBinding UseFloatingPlaceholder}" + PlaceholderForeground="{TemplateBinding PlaceholderForeground}" + PlaceholderText="{TemplateBinding PlaceholderText}">