清除返回堆栈导航 Windows 10 [英] Clear Back Stack Navigation Windows 10
本文介绍了清除返回堆栈导航 Windows 10的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想清除我的导航返回堆栈历史...
I want to Clear my Navigation Back Stack History ...
我尝试使用 this.NavigationService.RemoveBackEntry();
但它没有用.
I tried to use this.NavigationService.RemoveBackEntry();
but It didn't work.
如何在 Windows 10 中执行此操作?
How could I do this in Windows 10?
推荐答案
如果您在页面代码后面,您是否尝试过这样做:
If you're in page code behind, have you tried doing:
this.Frame.BackStack.Clear();
或者如果您在其他地方(例如 ViewModel),您是否尝试过:
or if you're somewhere else (like a ViewModel), have you tried:
var frame = Window.Current.Content as Frame;
frame.BackStack.Clear();
这篇关于清除返回堆栈导航 Windows 10的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文