Pattern 10: Hamburger Menu Keyboard Shortcuts

I am new to uwp application development. I made a simple application based on the Template 10 Hamburger template. I would like to access the hamburger menu using a keyboard shortcut. How is this possible?

I am trying to use AccessKey, but HamburgerButtonInfo does not have this property, so I am trying:

    <Controls:HamburgerButtonInfo x:Name="SettingsButton" 
                                          PageParameter="0" 
                                          PageType="views:SettingsPage">
           <StackPanel Orientation="Horizontal" AccessKey="D" >
                    <SymbolIcon Width="48"
                                Height="48"
                                Symbol="Setting" />
                    <TextBlock Margin="12,0,0,0"
                               VerticalAlignment="Center"
                               Text="Settings" />
           </StackPanel>
     </Controls:HamburgerButtonInfo>

But the result is an exception to the message: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))

Any ideas?

Thank you, Radim

+4
source share
1 answer

As @KenTucker said:

Try putting the passkey in the text block and handle the AccessKeyInvoked event of the text block to jump to the view.

, .

10.

0

Source: https://habr.com/ru/post/1672625/


All Articles