ShowErrorWindow now actually shows the ErrorWindow
This commit is contained in:
1 parent
99a666afd8
commit
4fcae0b3c7
10 files changed
+104
-30
No files matched your search
@@ -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>
|
||||
@@ -0,0 +1,11 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace PcgsInvUi.Views;
|
||||
|
||||
public partial class ErrorWindow : Window {
|
||||
public ErrorWindow() {
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in new issue
Block a user