Neethu pradeep

Neethu pradeep

  • NA
  • 36
  • 10.7k

Back navigation of pages

Dec 4 2018 3:36 AM
Have a List if Region. On selecting a region it shoe list of countries on that region on another page.selecting a country from next page it shows the details of that country on another page.how can i navigate back to each page???
  1. public sealed partial class MainPage : Page  
  2. {  
  3. public MainPage()  
  4. {  
  5. this.InitializeComponent();  
  6.   
  7. DataContext = new MainViewModel();  
  8. }  
  9. protected override void OnNavigatedTo(NavigationEventArgs e)  
  10. {  
  11.   
  12. }  
  13.   
  14. private void ListView_ItemClick(object sender, ItemClickEventArgs e)  
  15. {  
  16. WorkItem i = (e.ClickedItem as WorkItem);  
  17. Frame.Navigate(typeof(Country), i);  
  18. }  
  19. }  
country_List.xaml.cs 
  1. public sealed partial class Country : Page  
  2.    {  
  3.        public Country()  
  4.        {  
  5.            this.InitializeComponent();  
  6.        }  
  7.   
  8.          
  9.        protected override void OnNavigatedTo(NavigationEventArgs e)  
  10.        {  
  11.            WorkItem Name = e.Parameter as WorkItem;  
  12.            base.OnNavigatedTo(e);  
  13.            this.DataContext = new CountryViewModel(Name);  
  14.        }  
  15.   
  16.    }  
 
 how can i navigate back to my main page...

Answers (1)