override Items property to add datavalidations
MODIFY
WalletWasabi.Fluent/Controls/TagsBox.xaml.cs
WalletWasabi.Fluent/Controls/TagsBox.xaml.cs
@@ -34,12 +34,19 @@ namespace WalletWasabi.Fluent.Controls
o => o.Suggestions,
(o, v) => o.Suggestions = v);
+ public new static readonly DirectProperty<TagsBox, IEnumerable> ItemsProperty =
+ ItemsControl.ItemsProperty.AddOwnerWithDataValidation<TagsBox>(
+ o => o.Items,
+ (o, v) => o.Items = v,
+ defaultBindingMode: BindingMode.TwoWay,
+ enableDataValidation: true);
+
private AutoCompleteBox? _autoCompleteBox;
private bool _backspaceEmptyField1;
private bool _backspaceEmptyField2;
private IDisposable? _disposable;
-
+ private IEnumerable _items;
private bool _isInputEnabled = true;
private IEnumerable? _suggestions;
private bool _isFocused;
@@ -56,12 +63,17 @@ namespace WalletWasabi.Fluent.Controls
set => SetValue(SelectedTagProperty, value);
}
+ public new IEnumerable Items
+ {
+ get => _items;
+ set => SetAndRaise(ItemsProperty, ref _items, value);
+ }
+
public int ItemCountLimit
{
get => GetValue(ItemCountLimitProperty);
set => SetValue(ItemCountLimitProperty, value);
}
-
public IEnumerable? Suggestions
{
get => _suggestions;

override Items property to add datavalidations