I tried this:
<Page.InputBindings>
<KeyBinding Command="{Binding NavigationCommands.BrowseBack}" Key="Esc"/>
</Page.InputBindings>
And this:
<Page.InputBindings>
<KeyBinding Command="NavigationCommands.BrowseBack" Key="Esc"/>
</Page.InputBindings>
But still the navigation doesn't go back when I press escape. How do I make this key binding work?