Skip to content

Commit a805180

Browse files
authored
Fixed a bug where enter key does not work to confirm delete action (#878)
* Fixed enter key bug * Added keyboard shortcut
1 parent 95f3986 commit a805180

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

Files/Dialogs/ConfirmDeleteDialog.xaml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
x:Class="Files.Dialogs.ConfirmDeleteDialog"
33
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
44
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:converters="using:Files.Converters"
56
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
67
xmlns:local1="using:Files"
78
xmlns:local2="using:Files.Helpers"
89
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
9-
xmlns:converters="using:Files.Converters"
1010
x:Uid="ConfirmDeleteDialog"
1111
Title="Delete Item(s)"
1212
CornerRadius="4"
13-
mc:Ignorable="d"
14-
RequestedTheme="{x:Bind local2:ThemeHelper.RootTheme}">
13+
RequestedTheme="{x:Bind local2:ThemeHelper.RootTheme}"
14+
mc:Ignorable="d">
1515
<ContentDialog.Resources>
1616
<converters:StorageDeleteOptionToBooleanConverter x:Key="StorageDeleteOptionToBooleanConverter" />
1717
</ContentDialog.Resources>
@@ -41,19 +41,24 @@
4141
Orientation="Horizontal"
4242
Spacing="10">
4343

44-
<Button
45-
x:Name="btnCancel"
46-
x:Uid="ConfirmDeleteDialogCancelButton"
47-
Click="btnCancel_Click"
48-
Content="Cancel" />
49-
5044
<Button
5145
x:Name="btnDelete"
5246
x:Uid="ConfirmDeleteDialogDeleteButton"
5347
Background="{ThemeResource SystemAccentColor}"
5448
Click="btnDelete_Click"
5549
Content="Delete"
56-
TabIndex="0" />
50+
TabIndex="0">
51+
<Button.KeyboardAccelerators>
52+
<KeyboardAccelerator Key="Enter" />
53+
<KeyboardAccelerator Key="Space" />
54+
</Button.KeyboardAccelerators>
55+
</Button>
56+
57+
<Button
58+
x:Name="btnCancel"
59+
x:Uid="ConfirmDeleteDialogCancelButton"
60+
Click="btnCancel_Click"
61+
Content="Cancel" />
5762
</StackPanel>
5863
</Grid>
5964
</ContentDialog>

0 commit comments

Comments
 (0)