Skip to content

Commit

Permalink
Improve Gallery
Browse files Browse the repository at this point in the history
  • Loading branch information
ghost1372 committed Dec 27, 2024
1 parent 2a02257 commit c97954d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 7 additions & 1 deletion dev/DevWinUI.Gallery/Views/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@
PlaceholderText="Search"
QueryIcon="Find"
QuerySubmitted="OnQuerySubmitted"
TextChanged="OnTextChanged" />
TextChanged="OnTextChanged">
<AutoSuggestBox.KeyboardAccelerators>
<KeyboardAccelerator Key="F"
Invoked="KeyboardAccelerator_Invoked"
Modifiers="Control" />
</AutoSuggestBox.KeyboardAccelerators>
</AutoSuggestBox>
</TitleBar.Content>
<TitleBar.Footer>
<Button x:Name="ThemeButton"
Expand Down
5 changes: 5 additions & 0 deletions dev/DevWinUI.Gallery/Views/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,10 @@ private void OnQuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmitte
{
AutoSuggestBoxHelper.OnITitleBarAutoSuggestBoxQuerySubmittedEvent(sender, args, NavFrame);
}

private void KeyboardAccelerator_Invoked(Microsoft.UI.Xaml.Input.KeyboardAccelerator sender, Microsoft.UI.Xaml.Input.KeyboardAcceleratorInvokedEventArgs args)
{
HeaderAutoSuggestBox.Focus(FocusState.Programmatic);
}
}

0 comments on commit c97954d

Please sign in to comment.