How to send a list of object from my MainPage.xaml to another page
- by LivingThing
When navigating to another page how can i make my list of object available to another page.
for example in my mainpage.xaml
var data2 = from query in document.Descendants("weather")
select new Forecast
{
date = (string)query.Element("date"),
tempMaxC = (string)query.Element("tempMaxC"),
tempMinC = (string)query.Element("tempMinC"),
weatherIconUrl = (string)query.Element("weatherIconUrl"),
};
forecasts = data2.ToList<Forecast>();
....
NavigationService.Navigate(new Uri("/WeatherInfoPage.xaml", UriKind.Relative));
and then in my other class, i want to make it available so that i can use it like this
private void AddPageItem(List<Forecast> forecasts)
{
..
}