2014-05-01 78 views
2

我是程序从世界级调用到县级。当我satrt国家,我用这样的:WPF用新参数重新加载页面

this.NavigationService.Navigate(new Country("Italy")); 

从国家I类希望用户可以切换的国家,但withot调用

this.NavigationService.Navigate(new Country("USA")); 

,因为我想保留我的背选项去回到世界。所以我需要这样的一些东西:

this.NavigationService.GoBack(); //not works 
this.NavigationService.Navigate(new Country("UK")); 

但后面似乎没有工作。那么,我怎样才能用新的参数来刷新我的Country类,像Refresh这样的东西(“UK”)呢?

回答

2

您可以尝试通过调用RemoveBackEntry()方法从导航回到堆栈删除以前的国家页:

//refresh page with new country USA 
this.NavigationService.Navigate(new Country("USA")); 
//remove previous country Italy from back stack 
//so that back option will bring the application to World page 
this.NavigationService.RemoveBackEntry();