Skip to content

Commit b94ade0

Browse files
committed
github: add double-click to select behaviour to select account
Add the ability to double-click to select an account and 'continue' for the account selection Avalonia window.
1 parent 28b2091 commit b94ade0

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/shared/GitHub/UI/Views/SelectAccountView.axaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@
4848
Margin="20,0,20,10"
4949
MaxHeight="200"
5050
Background="Transparent"
51-
AutoScrollToSelectedItem="True">
51+
AutoScrollToSelectedItem="True"
52+
DoubleTapped="ListBox_OnDoubleTapped">
5253
<ListBox.ItemTemplate>
5354
<DataTemplate DataType="vm:AccountViewModel">
5455
<DockPanel LastChildFill="True">

src/shared/GitHub/UI/Views/SelectAccountView.axaml.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
using Avalonia;
22
using Avalonia.Controls;
3+
using Avalonia.Input;
34
using Avalonia.Markup.Xaml;
5+
using GitHub.UI.ViewModels;
46

57
namespace GitHub.UI.Views;
68

@@ -15,4 +17,12 @@ private void InitializeComponent()
1517
{
1618
AvaloniaXamlLoader.Load(this);
1719
}
20+
21+
private void ListBox_OnDoubleTapped(object sender, TappedEventArgs e)
22+
{
23+
if (DataContext is SelectAccountViewModel { SelectedAccount: not null } vm)
24+
{
25+
vm.ContinueCommand.Execute(null);
26+
}
27+
}
1828
}

0 commit comments

Comments
 (0)