本文介绍了标题栏后退键UWP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我见过的Windows设置,使用的是后退按钮标题酒吧;并希望有类似的东西在我的UAP但由于Win10是pretty的新我找不到任何信息,如果这是可以实现以简单的方式。

I've seen that the windows settings are using a back button in the title bar; and would like to include something like that in my UAP but since Win10 is pretty new I couldn't find any information if this is achievable in a simple way.

非常感谢

推荐答案

您可以轻松地激活后退按钮这样的:

You can activate the back button easily like this:

using Windows.UI.Core;

var currentView = SystemNavigationManager.GetForCurrentView();
currentView.AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;

请注意,背面事件与同一视图中的 BackRequested 事件处理:

Please note, that the back event is handled with the BackRequested event on the same view:

currentView.BackRequested += // Event handler goes here

请注意:后退按钮只显示在标题栏中,当应用程序在桌面模式下运行。当应用程序在平板模式下运行,返回按钮移动到Windows任务栏(左下)。

Please note: The back button is only displayed in the title bar, when the app is running in desktop mode. When the app is running in tablet mode, the back button is moved to the Windows task bar (bottom left).

这篇关于标题栏后退键UWP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-04 22:08