private void Application_Closing(object sender, ClosingEventArgs e) { //when closing the application save to situation to isolated file storage MainPage page = RootFrame.Content as MainPage; SaveLocalCopy(page.CurrentCity.City); }