diff --git a/demo/Ursa.Demo/Pages/TagInputDemo.axaml b/demo/Ursa.Demo/Pages/TagInputDemo.axaml
index dadccf2..730921c 100644
--- a/demo/Ursa.Demo/Pages/TagInputDemo.axaml
+++ b/demo/Ursa.Demo/Pages/TagInputDemo.axaml
@@ -17,6 +17,7 @@
Margin="20"
AllowDuplicates="True"
Separator="-"
+ Watermark="Hello world"
Tags="{Binding Tags}" />
+
+
diff --git a/src/Ursa.Themes.Semi/Controls/TagInput.axaml b/src/Ursa.Themes.Semi/Controls/TagInput.axaml
index d79f9a6..f15bf93 100644
--- a/src/Ursa.Themes.Semi/Controls/TagInput.axaml
+++ b/src/Ursa.Themes.Semi/Controls/TagInput.axaml
@@ -25,6 +25,12 @@
BorderThickness="1"
CornerRadius="3">
+
+
@@ -123,10 +132,10 @@
Foreground="{TemplateBinding Foreground}" />
diff --git a/src/Ursa/Controls/TagInput/TagInput.cs b/src/Ursa/Controls/TagInput/TagInput.cs
index 30773d4..4cdba32 100644
--- a/src/Ursa/Controls/TagInput/TagInput.cs
+++ b/src/Ursa/Controls/TagInput/TagInput.cs
@@ -10,45 +10,89 @@ using Avalonia.Controls.Primitives;
using Avalonia.Controls.Templates;
using Avalonia.Input;
using Avalonia.Interactivity;
-using Avalonia.Layout;
using Avalonia.Styling;
+using Irihi.Avalonia.Shared.Common;
+using Irihi.Avalonia.Shared.Helpers;
namespace Ursa.Controls;
[TemplatePart(PART_ItemsControl, typeof(ItemsControl))]
+[TemplatePart(PART_Watermark, typeof(Visual))]
+[PseudoClasses(PseudoClassName.PC_Empty)]
public class TagInput : TemplatedControl
{
public const string PART_ItemsControl = "PART_ItemsControl";
-
- private readonly TextBox _textBox;
- private ItemsControl? _itemsControl;
-
+ public const string PART_Watermark = "PART_Watermark";
public static readonly StyledProperty> TagsProperty =
AvaloniaProperty.Register>(
nameof(Tags));
- public IList Tags
+ public static readonly StyledProperty WatermarkProperty = TextBox.WatermarkProperty.AddOwner();
+
+
+ public static readonly StyledProperty AcceptsReturnProperty =
+ TextBox.AcceptsReturnProperty.AddOwner();
+
+ public bool AcceptsReturn
{
- get => GetValue(TagsProperty);
- set => SetValue(TagsProperty, value);
+ get => GetValue(AcceptsReturnProperty);
+ set => SetValue(AcceptsReturnProperty, value);
}
+ public static readonly StyledProperty MaxCountProperty = AvaloniaProperty.Register(
+ nameof(MaxCount), int.MaxValue);
+
public static readonly DirectProperty ItemsProperty =
AvaloniaProperty.RegisterDirect(
nameof(Items), o => o.Items);
- private IList _items;
+ public static readonly StyledProperty InputThemeProperty =
+ AvaloniaProperty.Register(
+ nameof(InputTheme));
- public IList Items
+ public static readonly StyledProperty ItemTemplateProperty =
+ AvaloniaProperty.Register(
+ nameof(ItemTemplate));
+
+ public static readonly StyledProperty SeparatorProperty = AvaloniaProperty.Register(
+ nameof(Separator));
+
+ public static readonly StyledProperty LostFocusBehaviorProperty =
+ AvaloniaProperty.Register(
+ nameof(LostFocusBehavior));
+
+
+ public static readonly StyledProperty AllowDuplicatesProperty = AvaloniaProperty.Register(
+ nameof(AllowDuplicates), true);
+
+ public static readonly StyledProperty