simplify tagsbox... no need for indexing.
MODIFY
WalletWasabi.Fluent/Controls/TagsBox.axaml.cs
WalletWasabi.Fluent/Controls/TagsBox.axaml.cs
@@ -348,9 +348,9 @@ namespace WalletWasabi.Fluent.Controls
private void RemoveTag()
{
- if (Items is IList x && x.Count > 0)
+ if (Items is IList {Count: > 0} list)
{
- x.RemoveAt(Math.Max(0, x.Count - 1));
+ list.RemoveAt(list.Count - 1);
}
CheckIsInputEnabled();
@@ -368,9 +368,9 @@ namespace WalletWasabi.Fluent.Controls
internal void RemoveTargetTag(object? tag)
{
- if (Items is IList {Count: > 0} x && tag is { })
+ if (Items is IList list)
{
- x.RemoveAt(x.IndexOf(tag));
+ list.Remove(tag);
}
CheckIsInputEnabled();

MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/RecoverWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/RecoverWalletViewModel.cs
@@ -137,7 +137,7 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
private Interaction<(KeyPath, int), (KeyPath?, int?)> AdvancedOptionsInteraction { get; }
- public ObservableCollection<RecoveryWordIndexed> Mnemonics { get; } = new();
+ public ObservableCollection<string> Mnemonics { get; } = new();
private void ValidateMnemonics(IValidationErrors errors)
{
@@ -151,7 +151,7 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
{
if (!string.IsNullOrWhiteSpace(tagString) && Mnemonics.Count + 1 <= 12)
{
- Mnemonics.Add(new RecoveryWordIndexed(Mnemonics.Count + 1, tagString));
+ Mnemonics.Add(tagString);
}
SelectedTag = string.Empty;

DELETE
WalletWasabi.Fluent/ViewModels/AddWallet/RecoveryWordIndexed.cs
-namespace WalletWasabi.Fluent.ViewModels.AddWallet
-{
- public readonly struct RecoveryWordIndexed
- {
- public RecoveryWordIndexed(int index, string word)
- {
- Index = index;
- Word = word;
- }
-
- public int Index { get; }
- public string Word { get; }
-
- public override string ToString()
- {
- return Word;
- }
- }
-}
\ No newline at end of file

simplify tagsbox... no need for indexing.