我想清除我的导航返回堆栈历史...
我尝试使用this.NavigationService.RemoveBackEntry();
但它没有用。
我怎么能在 Windows 10 中做到这一点?
我想清除我的导航返回堆栈历史...
我尝试使用this.NavigationService.RemoveBackEntry();
但它没有用。
我怎么能在 Windows 10 中做到这一点?
如果您在页面代码后面,您是否尝试过:
this.Frame.BackStack.Clear();
或者如果您在其他地方(例如 ViewModel),您是否尝试过:
var frame = Window.Current.Content as Frame;
frame.BackStack.Clear();
在后面的代码中,你可以试试这个:
protected override void OnNavigatedFrom(NavigationEventArgs e){
if (this.GetType().HasRegionAttribute()){
base.PopFromBackStackTo(typeof(LastViewModel));
}
base.OnNavigatedFrom(e);
}