close the error dialog by pressing Enter/Esc

This commit is contained in:
2026-05-03 18:31:07 +03:00
parent 5a7dfc7f9a
commit 72997f832e
2 changed files with 20 additions and 9 deletions

View File

@@ -32,13 +32,16 @@
</StackPanel>
</StackPanel>
<!-- Action Button -->
<Button Grid.Row="1"
Content="Got it"
Click="Ok_Click"
HorizontalAlignment="Right"
Padding="25,8"
BorderThickness="0"
<!-- Action Button -->
<Button Grid.Row="1"
x:Name="OkButton"
Content="Got it"
Click="Ok_Click"
IsDefault="True"
IsCancel="True"
HorizontalAlignment="Right"
Padding="25,8"
BorderThickness="0"
CornerRadius="4"
Cursor="Hand">
<Button.Styles>

View File

@@ -1,5 +1,7 @@
using Avalonia.Controls;
using System;
using Avalonia.Controls;
using Avalonia.Interactivity;
using Avalonia.Threading;
namespace KeyKeeper.Views;
@@ -16,4 +18,10 @@ public partial class ErrorDialog : Window
{
Close();
}
}
protected override void OnOpened(EventArgs e)
{
base.OnOpened(e);
OkButton.Focus();
}
}