rename to a shorter name
MODIFY
WalletWasabi.Fluent/Behaviors/TagBoxAutoCompleteBoxBehavior.cs
WalletWasabi.Fluent/Behaviors/TagBoxAutoCompleteBoxBehavior.cs
@@ -12,16 +12,16 @@ namespace WalletWasabi.Fluent.Behaviors
{
public class TagBoxAutoCompleteBoxBehavior : Behavior<AutoCompleteBox>
{
- public static readonly StyledProperty<Action> EnterKeyOrSpacePressedActionProperty =
- AvaloniaProperty.Register<SplitViewAutoBehavior, Action>(nameof(EnterKeyOrSpacePressedAction));
+ public static readonly StyledProperty<Action> CommitTextActionProperty =
+ AvaloniaProperty.Register<SplitViewAutoBehavior, Action>(nameof(CommitTextAction));
public static readonly StyledProperty<Action> BackspaceAndEmptyTextActionProperty =
AvaloniaProperty.Register<SplitViewAutoBehavior, Action>(nameof(BackspaceAndEmptyTextAction));
- public Action EnterKeyOrSpacePressedAction
+ public Action CommitTextAction
{
- get => GetValue(EnterKeyOrSpacePressedActionProperty);
- set => SetValue(EnterKeyOrSpacePressedActionProperty, value);
+ get => GetValue(CommitTextActionProperty);
+ set => SetValue(CommitTextActionProperty, value);
}
public Action BackspaceAndEmptyTextAction
@@ -52,7 +52,7 @@ namespace WalletWasabi.Fluent.Behaviors
if (obj.Length > 1 && !string.IsNullOrEmpty(obj.Trim()) && obj.EndsWith(' '))
{
- EnterKeyOrSpacePressedAction?.Invoke();
+ CommitTextAction?.Invoke();
}
}
@@ -64,7 +64,7 @@ namespace WalletWasabi.Fluent.Behaviors
}
else if (e.Key == Key.Enter && !string.IsNullOrEmpty(AssociatedObject?.Text.Trim() ?? ""))
{
- EnterKeyOrSpacePressedAction?.Invoke();
+ CommitTextAction?.Invoke();
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/TagsBox/TagInputViewModel.cs
WalletWasabi.Fluent/ViewModels/TagsBox/TagInputViewModel.cs
@@ -11,7 +11,7 @@ namespace WalletWasabi.Fluent.ViewModels.TagsBox
private readonly ObservableAsPropertyHelper<IEnumerable> _suggestions;
private string _inputText;
- private Action _EnterKeyOrSpacePressedAction;
+ private Action _CommitTextAction;
private Action _backspaceAndEmptyTextAction;
private TagBoxViewModel _parent;
@@ -23,7 +23,7 @@ namespace WalletWasabi.Fluent.ViewModels.TagsBox
_suggestions = _parent.WhenAnyValue(x => x.Suggestions)
.ToProperty(this, x => x.Suggestions);
- this.EnterKeyOrSpacePressedAction += OnEnterKeyOrSpacePressedAction;
+ this.CommitTextAction += OnCommitTextAction;
this.BackspaceAndEmptyTextAction += OnBackspaceAndEmptyTextAction;
}
@@ -32,7 +32,7 @@ namespace WalletWasabi.Fluent.ViewModels.TagsBox
_parent.RemoveTag();
}
- private void OnEnterKeyOrSpacePressedAction()
+ private void OnCommitTextAction()
{
_parent.AddTag(InputText.Trim());
InputText = string.Empty;
@@ -44,10 +44,10 @@ namespace WalletWasabi.Fluent.ViewModels.TagsBox
set => this.RaiseAndSetIfChanged(ref _inputText, value);
}
- public Action EnterKeyOrSpacePressedAction
+ public Action CommitTextAction
{
- get => _EnterKeyOrSpacePressedAction;
- set => this.RaiseAndSetIfChanged(ref _EnterKeyOrSpacePressedAction, value);
+ get => _CommitTextAction;
+ set => this.RaiseAndSetIfChanged(ref _CommitTextAction, value);
}
public Action BackspaceAndEmptyTextAction

MODIFY
WalletWasabi.Fluent/Views/TagsBox/TagInputView.xaml
WalletWasabi.Fluent/Views/TagsBox/TagInputView.xaml
<AutoCompleteBox Text="{Binding InputText, Mode=TwoWay}" Items="{Binding Suggestions}">
<i:Interaction.Behaviors>
<behaviors:TagBoxAutoCompleteBoxBehavior
- EnterKeyOrSpacePressedAction="{Binding EnterKeyOrSpacePressedAction, Mode=TwoWay}"
+ CommitTextAction="{Binding CommitTextAction, Mode=TwoWay}"
BackspaceAndEmptyTextAction="{Binding BackspaceAndEmptyTextAction, Mode=TwoWay}" />
</i:Interaction.Behaviors>
</AutoCompleteBox>

rename to a shorter name