New to C# so I’m confused. I have this kind scenario:
private void result_Click(object sender, RoutedEventArgs e)
{
var data = from query in Event.Descendants("event")
select new EventManager
{
name = (string)query.Element("name"),
place = (string)query.Element("place"),
date = (DateTime)query.Element("date"),
time = (DateTime)query.Element("time")
};
myListBox.ItemsSource = data;
}
- If I want to save data in an array/container?
- If I want to retrieve data from the ListBox later on?
You can set and later on get ItemsSource like this
Just like List you can have any container you want