UI tweaks on Tx Broadcaster
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/TransactionBroadcasterView.xaml
WalletWasabi.Gui/Controls/WalletExplorer/TransactionBroadcasterView.xaml
<Border BorderThickness="1" BorderBrush="{DynamicResource ThemeBorderHighBrush}" Background="Transparent" Margin="0,8,0,8" Padding="4">
<i:Interaction.Behaviors>
- <behaviors:CommandOnClickBehavior Command="{Binding PasteCommand}" />
+ <behaviors:CommandOnClickReleaseBehavior Command="{Binding PasteCommand}" />
</i:Interaction.Behaviors>
- <controls:ExtendedTextBox BorderThickness="0" Margin="0" Padding="0" Text="{Binding TransactionString}" IsReadOnly="{Binding IsBusy}" Watermark="Click here to insert from clipboard" TextWrapping="Wrap" AcceptsReturn="True">
+ <controls:ExtendedTextBox BorderThickness="0" Margin="0" Padding="0" Text="{Binding TransactionString}" IsReadOnly="{Binding IsBusy}" Watermark="Click here to insert from clipboard" TextWrapping="Wrap" AcceptsReturn="True" CaretIndex="{Binding CaretIndex}">
<i:Interaction.Behaviors>
- <behaviors:CommandOnClickBehavior Command="{Binding PasteCommand}" />
+ <behaviors:CommandOnClickReleaseBehavior Command="{Binding PasteCommand}" />
</i:Interaction.Behaviors>
</controls:ExtendedTextBox>
</Border>

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/TransactionBroadcasterViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/TransactionBroadcasterViewModel.cs
@@ -15,6 +15,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
private string _successMessage;
private bool _isBusy;
private string _buttonText;
+ private int _caretIndex;
private CompositeDisposable Disposables { get; set; }
public ReactiveCommand<Unit, Unit> PasteCommand { get; set; }
@@ -50,6 +51,12 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
set => this.RaiseAndSetIfChanged(ref _buttonText, value);
}
+ public int CaretIndex
+ {
+ get => _caretIndex;
+ set => this.RaiseAndSetIfChanged(ref _caretIndex, value);
+ }
+
public TransactionBroadcasterViewModel(WalletViewModel walletViewModel) : base("Transaction Broadcaster", walletViewModel)
{
ButtonText = "Broadcast Transaction";
@@ -110,8 +117,9 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
{
try
{
- if (string.IsNullOrEmpty(text))
+ if (string.IsNullOrWhiteSpace(text))
{
+ TransactionString = "";
return;
}

UI tweaks on Tx Broadcaster