ShowErrorWindow now actually shows the ErrorWindow

This commit is contained in:
alphafetus authored and BobdaFett committed 2023-11-23 18:19:47 -05:00
1 parent d667e86b1b
commit e73f9db02c
10 files changed
+104 -30

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewModels="clr-namespace:PcgsInvUi.ViewModels"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="PcgsInvUi.Views.ErrorWindow" x:DataType="viewModels:ErrorWindowViewModel"
Title="ErrorWindow">
<Grid RowDefinitions="2">
<TextBlock Text="{Binding DisplayedException.Message}" />
<Button Content="OK" Command="{Binding CloseCommand}" />
</Grid>
</Window>
+11
View File
@@ -0,0 +1,11 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace PcgsInvUi.Views;
public partial class ErrorWindow : Window {
public ErrorWindow() {
InitializeComponent();
}
}
+2 -1
View File
@@ -14,6 +14,7 @@ public partial class MainWindow : ReactiveWindow<MainWindowViewModel> {
InitializeComponent();
this.WhenActivated(d => d(ViewModel!.ShowDeleteWindow.RegisterHandler(ShowDeleteWindowAsync)));
this.WhenActivated(d => d(ViewModel!.ShowExportWindow.RegisterHandler(ShowFilePickerAsync)));
this.WhenActivated(d => d(ViewModel!.ShowErrorWindow.RegisterHandler(ShowErrorWindowAsync)));
// this.WhenActivated(d => d(ViewModel!.ShowFindWindow.RegisterHandler(ShowFindWindowAsync)));
}
@@ -54,7 +55,7 @@ public partial class MainWindow : ReactiveWindow<MainWindowViewModel> {
}
}
public async Task ShowErrorWindowAsync(InteractionContext<Unit, Unit> interaction) {
public async Task ShowErrorWindowAsync(InteractionContext<ErrorWindowViewModel, Unit> interaction) {
var window = new ErrorWindow();
window.DataContext = interaction.Input;