diff --git a/demo/Ursa.Demo/Pages/TagInputDemo.axaml b/demo/Ursa.Demo/Pages/TagInputDemo.axaml
index aa17cb2..730921c 100644
--- a/demo/Ursa.Demo/Pages/TagInputDemo.axaml
+++ b/demo/Ursa.Demo/Pages/TagInputDemo.axaml
@@ -26,5 +26,13 @@
Separator="-"
Tags="{Binding DistinctTags}" />
+
+
diff --git a/src/Ursa.Themes.Semi/Controls/TagInput.axaml b/src/Ursa.Themes.Semi/Controls/TagInput.axaml
index 0357f07..f15bf93 100644
--- a/src/Ursa.Themes.Semi/Controls/TagInput.axaml
+++ b/src/Ursa.Themes.Semi/Controls/TagInput.axaml
@@ -29,6 +29,7 @@
Name="{x:Static u:TagInput.PART_Watermark}"
Opacity="0.5"
IsVisible="False"
+ VerticalAlignment="Center"
Text="{TemplateBinding Watermark}" />
WatermarkProperty = TextBox.WatermarkProperty.AddOwner();
+
+ public static readonly StyledProperty AcceptsReturnProperty =
+ TextBox.AcceptsReturnProperty.AddOwner();
+
+ public bool AcceptsReturn
+ {
+ get => GetValue(AcceptsReturnProperty);
+ set => SetValue(AcceptsReturnProperty, value);
+ }
+
public static readonly StyledProperty MaxCountProperty = AvaloniaProperty.Register(
nameof(MaxCount), int.MaxValue);
@@ -82,6 +92,7 @@ public class TagInput : TemplatedControl
public TagInput()
{
_textBox = new TextBox();
+ _textBox[!AcceptsReturnProperty] = this.GetObservable(AcceptsReturnProperty).ToBinding();
_textBox.AddHandler(KeyDownEvent, OnTextBoxKeyDown, RoutingStrategies.Tunnel);
_textBox.AddHandler(LostFocusEvent, OnTextBox_LostFocus, RoutingStrategies.Bubble);
Items = new AvaloniaList