Remove subscription, normalize suggestions across usage
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/ReceiveTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/ReceiveTabViewModel.cs
@@ -90,19 +90,6 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
await address.TryCopyToClipboardAsync();
});
- this.WhenAnyValue(x => x.CaretIndex).Subscribe(_ =>
- {
- if (Label is null)
- {
- return;
- }
-
- if (CaretIndex != Label.Length)
- {
- CaretIndex = Label.Length;
- }
- });
-
var isCoinListItemSelected = this.WhenAnyValue(x => x.SelectedAddress).Select(coin => coin != null);
CopyAddress = ReactiveCommand.CreateFromTask(async () =>

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/SendTabView.xaml
WalletWasabi.Gui/Controls/WalletExplorer/SendTabView.xaml
</i:Interaction.Behaviors>
</controls:ExtendedTextBox>
<StackPanel Spacing="8">
- <controls:ExtendedTextBox x:Name="LabelTextBox" Text="{Binding Label}" Watermark="Label" UseFloatingWatermark="True" IsReadOnly="{Binding IsMax}" ToolTip.Tip="{Binding LabelToolTip}" CaretIndex="{Binding CaretIndex, Mode=TwoWay}">
+ <controls:ExtendedTextBox x:Name="LabelTextBox" Text="{Binding Label}" Watermark="Label" UseFloatingWatermark="True" IsReadOnly="{Binding IsMax}" ToolTip.Tip="{Binding LabelToolTip}" CaretIndex="{Binding CaretIndex}">
<i:Interaction.Behaviors>
<behaviors:SuggestionBehavior SuggestionItems="{Binding Suggestions}" />
<behaviors:CommandOnEnterBehavior Command="{Binding GenerateCommand}" />

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/SendTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/SendTabViewModel.cs
@@ -56,13 +56,14 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
private string _amountToolTip;
private bool _isBusy;
private bool _isHardwareBusy;
+ private int _caretIndex;
+
private const string SendTransactionButtonTextString = "Send Transaction";
private const string WaitingForHardwareWalletButtonTextString = "Waiting for Hardware Wallet...";
private const string SendingTransactionButtonTextString = "Sending Transaction...";
private const string BuildTransactionButtonTextString = "Build Transaction";
private const string BuildingTransactionButtonTextString = "Building Transaction...";
- private int _caretIndex;
private ObservableCollection<SuggestionViewModel> _suggestions;
private FeeDisplayFormat _feeDisplayFormat;
@@ -198,21 +199,6 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(_ => SetFeesAndTexts());
- this.WhenAnyValue(x => x.CaretIndex)
- .ObserveOn(RxApp.MainThreadScheduler)
- .Subscribe(_ =>
- {
- if (Label is null)
- {
- return;
- }
-
- if (CaretIndex != Label.Length)
- {
- CaretIndex = Label.Length;
- }
- });
-
MaxCommand = ReactiveCommand.Create(() => { IsMax = !IsMax; }, outputScheduler: RxApp.MainThreadScheduler);
this.WhenAnyValue(x => x.IsMax)
.ObserveOn(RxApp.MainThreadScheduler)

MODIFY
WalletWasabi.Gui/Tabs/WalletManager/RecoverWalletViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/RecoverWalletViewModel.cs
@@ -106,14 +106,6 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
}
});
- this.WhenAnyValue(x => x.CaretIndex).Subscribe(_ =>
- {
- if (CaretIndex != MnemonicWords.Length)
- {
- CaretIndex = MnemonicWords.Length;
- }
- });
-
_suggestions = new ObservableCollection<SuggestionViewModel>();
}

Remove subscription, normalize suggestions across usage