@@ -17,6 +17,7 @@ public sealed partial class Toolbar : UserControl
17
17
private readonly ICommandManager Commands = Ioc . Default . GetRequiredService < ICommandManager > ( ) ;
18
18
private readonly IModifiableCommandManager ModifiableCommands = Ioc . Default . GetRequiredService < IModifiableCommandManager > ( ) ;
19
19
private readonly IAddItemService addItemService = Ioc . Default . GetRequiredService < IAddItemService > ( ) ;
20
+ private readonly IContentPageContext ContentPageContext = Ioc . Default . GetRequiredService < IContentPageContext > ( ) ;
20
21
21
22
[ GeneratedDependencyProperty ]
22
23
public partial NavigationToolbarViewModel ? ViewModel { get ; set ; }
@@ -108,5 +109,12 @@ private void AppBarButton_AccessKeyInvoked(UIElement sender, AccessKeyInvokedEve
108
109
if ( VisualTreeHelper . GetOpenPopupsForXamlRoot ( MainWindow . Instance . Content . XamlRoot ) . Any ( ) )
109
110
args . Handled = true ;
110
111
}
112
+
113
+ private void RootGrid_PointerReleased ( object sender , PointerRoutedEventArgs e )
114
+ {
115
+ // Workaround for issue where clicking the toolbar prevents keyboard
116
+ // shortcuts from working, see https://github.com/microsoft/microsoft-ui-xaml/issues/6467
117
+ DispatcherQueue . TryEnqueue ( ( ) => ContentPageContext . ShellPage ! . PaneHolder . FocusActivePane ( ) ) ;
118
+ }
111
119
}
112
120
}
0 commit comments