Add button functionality
MODIFY
WalletWasabi.Gui/CrashReport/ViewModels/CrashReportWindowViewModel.cs
WalletWasabi.Gui/CrashReport/ViewModels/CrashReportWindowViewModel.cs
+using ReactiveUI;
using Splat;
+using System;
+using System.Reactive;
+using System.Reactive.Linq;
+using WalletWasabi.Gui.Controls.WalletExplorer;
+using WalletWasabi.Gui.Helpers;
+using WalletWasabi.Logging;
namespace WalletWasabi.Gui.CrashReport.ViewModels
{
@@ -8,6 +15,24 @@ namespace WalletWasabi.Gui.CrashReport.ViewModels
{
var global = Locator.Current.GetService<Global>();
CrashReporter = global.CrashReporter;
+
+ OpenLogCommand = ReactiveCommand.CreateFromTask(async () =>
+ {
+ await FileHelpers.OpenFileInTextEditorAsync(Logger.FilePath);
+ });
+
+ OkCommand = ReactiveCommand.Create(() =>
+ {
+ });
+
+ Observable
+ .Merge(OpenLogCommand.ThrownExceptions)
+ .Merge(OkCommand.ThrownExceptions)
+ .ObserveOn(RxApp.TaskpoolScheduler)
+ .Subscribe(ex =>
+ {
+ Logger.LogError(ex);
+ });
}
private CrashReporter CrashReporter { get; }
@@ -16,5 +41,8 @@ namespace WalletWasabi.Gui.CrashReport.ViewModels
public string Title => "Wasabi Wallet - Crash Reporting";
public string Details => "Wasabi has crashed. You can check the details here, open the log file, or report the crash to the support team. Please always consider your privacy before sharing any information!";
public string Message => CrashReporter.GetException().Message;
+
+ public ReactiveCommand<Unit, Unit> OpenLogCommand { get; }
+ public ReactiveCommand<Unit, Unit> OkCommand { get; }
}
}

MODIFY
WalletWasabi.Gui/CrashReport/Views/CrashReportWindow.xaml
WalletWasabi.Gui/CrashReport/Views/CrashReportWindow.xaml
Classes="ToolWindow">
<DockPanel LastChildFill="True" Margin="25,0,25,25">
<StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" HorizontalAlignment="Right" Spacing="5" Margin="0,25,0,0">
- <Button MinWidth="135" Height="35">Open logs</Button>
- <Button MinWidth="135" Height="35" Background="{DynamicResource ThemeAccentBrush}">Ok</Button>
+ <Button MinWidth="135" Height="35" Command="{Binding OpenLogCommand}">Open logs</Button>
+ <Button MinWidth="135" Height="35" Background="{DynamicResource ThemeAccentBrush}" Command="{Binding OkCommand}">Ok</Button>
</StackPanel>
<TextBlock DockPanel.Dock="Top" FontWeight="Bold" FontSize="18" Margin="0,0,0,25" Text="{Binding Message}" />
<controls:MultiTextBox Text="{Binding Details}" />

Add button functionality