2014-05-01 36 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();