【发布时间】:2015-10-31 09:38:08
【问题描述】:
我想清除我的导航返回堆栈历史...
我尝试使用this.NavigationService.RemoveBackEntry();,但没有成功。
如何在 Windows 10 中执行此操作?
【问题讨论】:
标签: c# windows-10 windows-10-mobile
我想清除我的导航返回堆栈历史...
我尝试使用this.NavigationService.RemoveBackEntry();,但没有成功。
如何在 Windows 10 中执行此操作?
【问题讨论】:
标签: c# windows-10 windows-10-mobile
在后面的代码中,你可以试试这个:
protected override void OnNavigatedFrom(NavigationEventArgs e){
if (this.GetType().HasRegionAttribute()){
base.PopFromBackStackTo(typeof(LastViewModel));
}
base.OnNavigatedFrom(e);
}
【讨论】:
如果你在页面代码后面,你有没有尝试过:
this.Frame.BackStack.Clear();
或者如果您在其他地方(例如 ViewModel),您是否尝试过:
var frame = Window.Current.Content as Frame;
frame.BackStack.Clear();
【讨论】: