Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit bb48441

Browse files
committed
Set focus on search box when select page visible
1 parent 1f26a8a commit bb48441

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/GitHub.VisualStudio.UI/Views/Dialog/Clone/SelectPageView.xaml.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
using System.ComponentModel.Composition;
1+
using System;
2+
using System.ComponentModel.Composition;
23
using System.Windows.Controls;
34
using System.Windows.Input;
5+
using System.Windows.Threading;
46
using GitHub.Exports;
57
using GitHub.ViewModels.Dialog.Clone;
68

@@ -13,6 +15,16 @@ public partial class SelectPageView : UserControl
1315
public SelectPageView()
1416
{
1517
InitializeComponent();
18+
19+
// See Douglas Stockwell's suggestion here:
20+
// https://social.msdn.microsoft.com/Forums/vstudio/en-US/30ed27ce-f7b7-48ae-8adc-0400b9b9ec78
21+
IsVisibleChanged += (sender, e) =>
22+
{
23+
if (IsVisible)
24+
{
25+
Dispatcher.BeginInvoke(DispatcherPriority.Input, (Action)(() => SearchTextBox.Focus()));
26+
}
27+
};
1628
}
1729

1830
protected override void OnPreviewMouseDown(MouseButtonEventArgs e)

0 commit comments

Comments
 (0)