Windowing and Page Navigation: Developer's Guide To Windows 10
Windowing and Page Navigation: Developer's Guide To Windows 10
Windowing and Page Navigation: Developer's Guide To Windows 10
ViewModel.OnNavigatedTo
With Template 10 project template
if
if (Frame.CanGoBack)
(Frame.CanGoBack)
{{
// Setting this visible is ignored on Mobile and when in tablet mode!
// Setting this visible is ignored on Mobile and when in tablet mode!
Windows.UI.Core.SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility
Windows.UI.Core.SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility ==
AppViewBackButtonVisibility.Visible;
AppViewBackButtonVisibility.Visible;
}}
Desktop, Windowed mode:
Or provide your own on-canvas Back Button
If the user has nowhere to go back to,
remove the back button from your UI
Back Navigation
Back navigates back within app page history, then to
previous app
Essentially same as Phone 8.1
public event EventHandler<BackRequestedEventArgs> OnBackRequested;
private void App_BackRequested(object sender, BackRequestedEventArgs e)
{
if (OnBackRequested != null) { OnBackRequested(this, e); }
// Check that no-one has already handled this
if (!e.Handled)
{
// Default is to navigate back within the Frame
Frame frame = Window.Current.Content as Frame;
if (frame.CanGoBack)
{
frame.GoBack();
// Signal handled so that system doesn't navigate back through app stack
e.Handled = true;
}
}
}
Back support
Support gestures
Windows + backspace
Hardware back button
Keyboard back button
Mouse back button
Some guidance
Don’t strand users
Don’t hijack back
Demo: Back Navigation
Review
Layout
Navigation
Handling Back Navigation
© 2015 Microsoft Corporation. All rights reserved.