Implement warningmessage into base
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/SendTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/SendTabViewModel.cs
@@ -56,8 +56,6 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
private string _amountToolTip;
private bool _isBusy;
private bool _isHardwareBusy;
- private string _warningMessage;
- private string _successMessage;
private const string SendTransactionButtonTextString = "Send Transaction";
private const string WaitingForHardwareWalletButtonTextString = "Waiting for Hardware Wallet...";
private const string SendingTransactionButtonTextString = "Sending Transaction...";
@@ -625,36 +623,6 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
}
}
- private void SetWarningMessage(string message)
- {
- SuccessMessage = "";
- WarningMessage = message;
-
- Dispatcher.UIThread.PostLogException(async () =>
- {
- await Task.Delay(7000);
- if (WarningMessage == message)
- {
- WarningMessage = "";
- }
- });
- }
-
- private void SetSuccessMessage(string message)
- {
- SuccessMessage = message;
- WarningMessage = "";
-
- Dispatcher.UIThread.PostLogException(async () =>
- {
- await Task.Delay(7000);
- if (SuccessMessage == message)
- {
- SuccessMessage = "";
- }
- });
- }
-
private void SetMax()
{
if (IsMax)
@@ -722,13 +690,15 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
private async Task DoDequeueAsync(IEnumerable<CoinViewModel> selectedCoins)
{
- WarningMessage = "";
-
if (!selectedCoins.Any())
{
SetWarningMessage("No coins are selected to dequeue.");
return;
}
+ else
+ {
+ SetWarningMessage("");
+ }
try
{
@@ -964,18 +934,6 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
set => this.RaiseAndSetIfChanged(ref _labelToolTip, value);
}
- public string WarningMessage
- {
- get => _warningMessage;
- set => this.RaiseAndSetIfChanged(ref _warningMessage, value);
- }
-
- public string SuccessMessage
- {
- get => _successMessage;
- set => this.RaiseAndSetIfChanged(ref _successMessage, value);
- }
-
public string FeeToolTip
{
get => _feeToolTip;

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/TransactionBroadcasterView.xaml
WalletWasabi.Gui/Controls/WalletExplorer/TransactionBroadcasterView.xaml
</Button>
<StackPanel Orientation="Vertical">
- <TextBlock Text="{Binding ErrorMessage}" Classes="warningMessage" />
+ <TextBlock Text="{Binding WarningMessage}" Classes="warningMessage" />
<TextBlock Text="{Binding SuccessMessage}" Classes="validationMessage" Foreground="Green" />
</StackPanel>
</DockPanel>

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/TransactionBroadcasterViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/TransactionBroadcasterViewModel.cs
@@ -14,8 +14,6 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
public class TransactionBroadcasterViewModel : WalletActionViewModel, IDocumentTabViewModel
{
private string _transactionString;
- private string _errorMessage;
- private string _successMessage;
private bool _isBusy;
private string _buttonText;
private int _caretIndex;
@@ -30,18 +28,6 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
set => this.RaiseAndSetIfChanged(ref _transactionString, value);
}
- public string ErrorMessage
- {
- get => _errorMessage;
- set => this.RaiseAndSetIfChanged(ref _errorMessage, value);
- }
-
- public string SuccessMessage
- {
- get => _successMessage;
- set => this.RaiseAndSetIfChanged(ref _successMessage, value);
- }
-
public bool IsBusy
{
get => _isBusy;
@@ -87,7 +73,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
private void OnException(Exception ex)
{
- ErrorMessage = ex.ToTypeMessageString();
+ SetWarningMessage(ex.ToTypeMessageString());
}
public override void OnOpen()
@@ -144,7 +130,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
await Task.Run(async () => await Global.WalletService.SendTransactionAsync(transaction));
- SuccessMessage = "Transaction is successfully sent!";
+ SetSuccessMessage("Transaction is successfully sent!");
TransactionString = "";
}
catch (Exception ex)

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/TransactionViewerViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/TransactionViewerViewModel.cs
@@ -12,8 +12,6 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
{
public class TransactionViewerViewModel : WalletActionViewModel
{
- private string _errorMessage;
- private string _successMessage;
private string _psbtJsonText;
private string _psbtHexText;
private string _psbtBase64Text;
@@ -38,25 +36,13 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
set => this.RaiseAndSetIfChanged(ref _psbtBase64Text, value);
}
- public string ErrorMessage
- {
- get => _errorMessage;
- set => this.RaiseAndSetIfChanged(ref _errorMessage, value);
- }
-
- public string SuccessMessage
- {
- get => _successMessage;
- set => this.RaiseAndSetIfChanged(ref _successMessage, value);
- }
-
public TransactionViewerViewModel(WalletViewModel walletViewModel) : base("Transaction", walletViewModel)
{
}
private void OnException(Exception ex)
{
- ErrorMessage = ex.ToTypeMessageString();
+ SetWarningMessage(ex.ToTypeMessageString());
}
public override void OnOpen()

Implement warningmessage into base