Fre*_*gar 15 .net c# windows titlebar win-universal-app
我已经看到Windows设置正在使用标题栏中的后退按钮 ; 并希望在我的UAP中包含类似的内容,但由于Win10很新,如果可以通过简单的方式实现,我找不到任何信息.
非常感谢
Her*_*rdo 29
您可以像这样轻松激活后退按钮:
using Windows.UI.Core;
var currentView = SystemNavigationManager.GetForCurrentView();
currentView.AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;
Run Code Online (Sandbox Code Playgroud)
请注意,BackRequested在同一视图中使用事件处理后退事件:
currentView.BackRequested += // Event handler goes here
Run Code Online (Sandbox Code Playgroud)
请注意:当应用程序在桌面模式下运行时,后退按钮仅显示在标题栏中.当应用程序以平板电脑模式运行时,后退按钮将移至Windows任务栏(左下角).
尽管建议的答案仍然适用于Win10 1803,但随着1709的发布,微软开始不鼓励使用AppViewBackButton来支持应用程序后退按钮.这是一些XAML:
<Button VerticalAlignment="Top" HorizontalAlignment="Left"
Style="{StaticResource NavigationBackButtonNormalStyle}"/>
Run Code Online (Sandbox Code Playgroud)
阅读更多:https: //docs.microsoft.com/en-us/windows/uwp/design/basics/navigation-history-and-backwards-navigation
| 归档时间: |
|
| 查看次数: |
7649 次 |
| 最近记录: |