add option for hiding delete button
MODIFY
WalletWasabi.Fluent/Controls/TagControl.axaml
WalletWasabi.Fluent/Controls/TagControl.axaml
Margin="-8,0,3,0">
<Button Name="PART_DeleteButton" VerticalAlignment="Center"
HorizontalAlignment="Center"
+ IsVisible="{TemplateBinding EnableDelete}"
Width="12"
Height="12"
KeyboardNavigation.IsTabStop="False"

MODIFY
WalletWasabi.Fluent/Controls/TagControl.axaml.cs
WalletWasabi.Fluent/Controls/TagControl.axaml.cs
using System;
using System.Reactive.Disposables;
+using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Primitives;
using Avalonia.Interactivity;
@@ -12,6 +13,15 @@ namespace WalletWasabi.Fluent.Controls
private IDisposable? _subscription;
private TagsBox? _parentTagBox;
+ public static readonly StyledProperty<bool> EnableDeleteProperty =
+ AvaloniaProperty.Register<TagControl, bool>(nameof(EnableDelete));
+
+ public bool EnableDelete
+ {
+ get => GetValue(EnableDeleteProperty);
+ set => SetValue(EnableDeleteProperty, value);
+ }
+
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
{
base.OnApplyTemplate(e);

MODIFY
WalletWasabi.Fluent/Controls/TagsBox.axaml
WalletWasabi.Fluent/Controls/TagsBox.axaml
</ItemsPresenter.ItemsPanel>
<ItemsPresenter.ItemTemplate>
<DataTemplate>
- <c:TagControl Content="{Binding .}" />
+ <c:TagControl Content="{Binding .}" EnableDelete="{Binding #PART_DockPanel.TemplatedParent.EnableDelete}"/>
</DataTemplate>
</ItemsPresenter.ItemTemplate>
</ItemsPresenter>

MODIFY
WalletWasabi.Fluent/Controls/TagsBox.axaml.cs
WalletWasabi.Fluent/Controls/TagsBox.axaml.cs
@@ -78,6 +78,9 @@ namespace WalletWasabi.Fluent.Controls
public static readonly StyledProperty<bool> IsReadOnlyProperty =
AvaloniaProperty.Register<TagsBox, bool>(nameof(IsReadOnly));
+ public static readonly StyledProperty<bool> EnableDeleteProperty =
+ AvaloniaProperty.Register<TagsBox, bool>(nameof(EnableDelete), true);
+
[Content]
public IEnumerable<string>? Items
{
@@ -145,6 +148,12 @@ namespace WalletWasabi.Fluent.Controls
set => SetValue(AllowDuplicationProperty, value);
}
+ public bool EnableDelete
+ {
+ get => GetValue(EnableDeleteProperty);
+ set => SetValue(EnableDeleteProperty, value);
+ }
+
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
{
base.OnApplyTemplate(e);
@@ -217,7 +226,6 @@ namespace WalletWasabi.Fluent.Controls
Dispatcher.UIThread.Post(() => _autoCompleteBox?.ClearValue(AutoCompleteBox.TextProperty));
})
.DisposeWith(_compositeDisposable!);
-
}
protected override void OnGotFocus(GotFocusEventArgs e)

MODIFY
WalletWasabi.Fluent/Views/AddWallet/RecoverWalletView.axaml
WalletWasabi.Fluent/Views/AddWallet/RecoverWalletView.axaml
Items="{Binding Mnemonics}"
Suggestions="{Binding Suggestions}"
CompletedCommand="{Binding NextCommand}"
- AllowDuplication="True">
+ AllowDuplication="True"
+ EnableDelete="False">
<i:Interaction.Behaviors>
<behaviors:FocusOnAttachedBehavior />
</i:Interaction.Behaviors>

add option for hiding delete button