custom title and error caption
MODIFY
WalletWasabi.Fluent/Helpers/FluentLogger.cs
WalletWasabi.Fluent/Helpers/FluentLogger.cs
@@ -9,8 +9,8 @@ namespace WalletWasabi.Fluent.Helpers
public static void ShowAndLogError(Exception ex)
{
Logger.LogError(ex);
- var dialog = new ShowErrorDialogViewModel(ex.Message);
- dialog.ShowDialogAsync();
+ // var dialog = new ShowErrorDialogViewModel(ex.Message);
+ // dialog.ShowDialogAsync();
}
}
}
\ No newline at end of file

MODIFY
WalletWasabi.Fluent/ViewModels/Dialogs/ShowErrorDialogViewModel.cs
WalletWasabi.Fluent/ViewModels/Dialogs/ShowErrorDialogViewModel.cs
@@ -4,13 +4,16 @@ namespace WalletWasabi.Fluent.ViewModels.Dialogs
{
public class ShowErrorDialogViewModel : DialogViewModelBase<bool>
{
- public ShowErrorDialogViewModel(string message)
+ public ShowErrorDialogViewModel(string message, string title, string caption)
{
Message = message;
+ Title = title;
+ Caption = caption;
NextCommand = ReactiveCommand.Create(() => Close());
}
public string Message { get; }
+ public string Caption { get; }
}
}
\ No newline at end of file

MODIFY
WalletWasabi.Fluent/ViewModels/Navigation/RoutableViewModel.cs
WalletWasabi.Fluent/ViewModels/Navigation/RoutableViewModel.cs
@@ -2,6 +2,7 @@ using System;
using System.Reactive.Disposables;
using System.Threading.Tasks;
using System.Windows.Input;
+using Avalonia.Controls.Chrome;
using ReactiveUI;
using WalletWasabi.Fluent.ViewModels.Dialogs;
using WalletWasabi.Gui.ViewModels;
@@ -22,10 +23,17 @@ namespace WalletWasabi.Fluent.ViewModels.Navigation
BackCommand = ReactiveCommand.Create(() => Navigate().Back());
CancelCommand = ReactiveCommand.Create(() => Navigate().Clear());
+
+ Title = "";
+ ErrorCaption = "We are sorry, something happened during the process.";
}
public virtual string IconName => "navigation_regular";
+ public string Title { get; set; }
+
+ public string ErrorCaption { get; set; }
+
public ICommand? NextCommand { get; protected set; }
public ICommand BackCommand { get; protected set; }
@@ -104,5 +112,11 @@ namespace WalletWasabi.Fluent.ViewModels.Navigation
return result;
}
+
+ protected void ShowError(string message)
+ {
+ var dialog = new ShowErrorDialogViewModel(message, Title, ErrorCaption);
+ dialog.ShowDialogAsync();
+ }
}
}

MODIFY
WalletWasabi.Fluent/Views/Dialogs/ShowErrorDialogView.axaml
WalletWasabi.Fluent/Views/Dialogs/ShowErrorDialogView.axaml
x:DataType="dialog:ShowErrorDialogViewModel"
x:CompileBindings="True"
x:Class="WalletWasabi.Fluent.Views.Dialogs.ShowErrorDialogView">
- <c:ContentArea Title="Something went wrong"
- Caption="We are sorry, something happened during the process."
- EnableNext="True" NextContent="Done"
+ <c:ContentArea Title="{Binding Title}"
+ Caption="{Binding Caption}"
+ EnableNext="True" NextContent="Ok"
ScrollViewer.VerticalScrollBarVisibility="Disabled">
<DockPanel VerticalAlignment="Center">
<TextBlock Text="{Binding Message}" DockPanel.Dock="Bottom" TextAlignment="Center" TextWrapping="Wrap" MaxWidth="500" Margin="20 0" />

custom title and error caption