- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
在调用NavigationService.GoBack()
之前我们需要检查NavigationService.CanGoBack
是否为真,但是NavigationService.CanGoBack
在什么情况下> 返回错误?
最佳答案
如果导航历史中没有任何内容,CanGoBack 将返回 false。有时可能没有为当前导航器添加最新条目(多个导航器)。
关于c# - NavigationService.CanGoBack 在哪些情况下返回 false?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27828956/
我试图在代码中从一个页面导航到另一个页面: if (Game.IsShopping) NavigationService.Navigate("ShopPage.xaml", Game.Curr
我创建了一个 Windows Phone 8.1 项目,其中我在不同的代码段中使用了以下代码: if (this.NavigationService.CanGoBack) { this.Nav
我读到有几个人对此有疑问,所以我想发布一个(有点)优雅的解决方案,我在尝试处理这个问题时想出了。问题是当您在 Silverlight 中创建模板页面并且 ContentControls 没有父 Fra
这似乎是一个非常幼稚的问题,但究竟如何从页面外部获取 NavigationService,例如可能是 View 模型?每个人都说导航应该出现在 View 中,但我一直在想,这不是一个网页,它是一个应用
我想从我的页面捕获 NavigationService.Navigating 事件,以防止用户向前导航。我有一个这样定义的事件处理程序: void PreventForwardNavigation(o
我在 WPF NavigationWindow 中托管了一个小示例应用程序。 它有三个页面(A、B、C)和三个按钮可供用户使用:导航窗口上的后退和前进以及第一页上的下一页。 第一页 A 包含两个单选按
我导航到WP7中的第X页。我的ViewModel中有一个对象(我们称其为香蕉),在该对象中进行NavigationService.Navigate调用。 X页面需要引用香蕉。我怎样才能做到这一点? t
我是 C# 编程的新手,我的代码有问题。我创建了一个按钮并在其上应用了一个事件点击,它通过 NavigationService 技术打开了我项目的另一个页面。 这是脚本: private void c
我正在学习 WP 编码,但遇到无法解决的问题:/ try { NavigationService.Navigate(new Uri("/edit.xaml", UriKind.Relativ
我看到很多关于删除后台堆栈的答案。 但是如何删除前向堆栈? 又名,导航 A,到 B,到 C A -> B -> C 然后我从 C 导航回 B(表单保存,C 关闭 NavigationService.G
设想: 我有一个这样的 NavigationWindow 样式: ... 我通
关于在 xamarin 应用程序中使用 autofac 以及何时使用它们的生命周期范围的初学者问题。 正如 autofac 文档 (https://nblumhardt.com/2011/01/an-
我正在处理的项目是一个基于桌面的 WPF 应用程序。我已经在其中实现了 MVVM 模式。我也在其中使用 Unity IoC 和存储库模式。 我在主详细信息类型场景中遇到问题。我导航到详细信息页面(我已
使用 NavigationService.RemoveBackEntry() 我可以从导航堆栈中删除一个条目。有没有一种方便的方法来删除我的应用程序中的所有后退导航项(场景:我有一个由多个页面组成的注
在我的根 View 模型中,我称之为 await _navigationService.NavigateAsync( "/NavigationPage/Page1of2", useMo
我有一个 Windows Phone 7.5 应用程序,它使用 NavigationService.GoBack() 方法在主页(MainPage.xaml,一个 PhoneApplicationPa
如您所见,我想导航到“ScoreInputDialog.xaml”页面,用户可以在其中键入名称。在此之后,我试图将名称保存到列表中,但它始终为空,因为导航到页面“ScoreInputDialog.xa
如果未设置 access_token,我将尝试导航到 MainPage.xaml。 public Menu() { InitializeCo
在调用NavigationService.GoBack()之前我们需要检查NavigationService.CanGoBack是否为真,但是NavigationService.CanGoBack在什
NavigationService.GoBack();我在 viewmodel 中设置了一个变量,然后我想返回,当我返回时我想使用那个变量,但似乎什么都没有运行,我不想刷新那个页面。 有什么想法吗?
我是一名优秀的程序员,十分优秀!