显示键盘时的 CommandBar 行为

CommandBar Behavior When Keyboard Is Show

我的 UWP 应用中有 CommandBar :

<Page.BottomAppBar>
    <CommandBar x:Name="BottomBar">
        <AppBarButton Icon="Save" Label="Save" Click="OnSave"/>
        <AppBarButton Icon="Clear" Label="Reset"/>
    </CommandBar>
</Page.BottomAppBar>

Windows Phone 8.1中,当显示Keyboard时,如果我按Save就会执行OnSave方法。 但是在UWP中,按下保存会隐藏Keyboard不执行Click事件。

我希望这个 CommandBar 表现得像 Windows Phone 8.1

我没测试过,不过你可以试试 IsTabStop="False":

<AppBarButton Icon="Save" Label="Save" Click="OnSave" IsTabStop="False"/>