Allowed ErrorWindow to close properly.
This commit is contained in:
1 parent
663fb256e5
commit
93219aaf9b
7 files changed
+16
-293
No files matched your search
@@ -12,8 +12,7 @@
|
||||
Margin="15"
|
||||
Content="{Binding DisplayedMessage}" />
|
||||
<Button Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Bottom"
|
||||
Margin="10" Name="CloseButton" IsEnabled="False"
|
||||
Content="Use X button" Command="{Binding CloseCommand, Mode=OneWay}"
|
||||
CommandParameter="{Binding ElementName=NameErrorWindow}"/>
|
||||
Margin="10" Name="CloseButton" IsEnabled="True"
|
||||
Content="OK" Command="{Binding CloseCommand, Mode=OneWay}" />
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using Avalonia.ReactiveUI;
|
||||
using PcgsInvUi.ViewModels;
|
||||
using ReactiveUI;
|
||||
|
||||
namespace PcgsInvUi.Views;
|
||||
|
||||
@@ -7,5 +9,6 @@ public partial class ErrorWindow : ReactiveWindow<ErrorWindowViewModel> {
|
||||
public ErrorWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.WhenActivated(d => d(ViewModel!.CloseCommand.Subscribe(Close)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ public partial class MainWindow : ReactiveWindow<MainWindowViewModel> {
|
||||
// this.WhenActivated(d => d(ViewModel!.ShowFindWindow.RegisterHandler(ShowFindWindowAsync)));
|
||||
}
|
||||
|
||||
private async Task ShowDeleteWindowAsync(InteractionContext<DeleteWindowViewModel, Boolean> interaction) {
|
||||
private async Task ShowDeleteWindowAsync(InteractionContext<DeleteWindowViewModel, bool> interaction) {
|
||||
var window = new DeleteWindow();
|
||||
window.DataContext = interaction.Input;
|
||||
|
||||
@@ -53,11 +53,11 @@ public partial class MainWindow : ReactiveWindow<MainWindowViewModel> {
|
||||
}
|
||||
}
|
||||
|
||||
private async Task ShowErrorWindowAsync(InteractionContext<ErrorWindowViewModel, Unit> interaction) {
|
||||
private async Task ShowErrorWindowAsync(InteractionContext<ErrorWindowViewModel, bool> interaction) {
|
||||
var window = new ErrorWindow();
|
||||
window.DataContext = interaction.Input;
|
||||
|
||||
await window.ShowDialog(this);
|
||||
interaction.SetOutput(Unit.Default);
|
||||
var result = await window.ShowDialog<bool>(this);
|
||||
interaction.SetOutput(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user