To the people that commented, thank you, sorry for things being a little.. less detailed when it comes to code portions, I wasn't able to show this code as i don't have anything attempting the retrieve items as i kept failing at doing so.. HOWEVER i figured this out this morning after i dropped my partner off to work.
This is my code solution:
private async void btnSave_Click(object sender, RoutedEventArgs e)
{
try
{
sortedItems = new List<favouritesitems>();
for (int i = 0; i < lvFavourites.Items.Count(); i++)
{
lvFavourites.SelectedIndex = i;
FavouritesItems item = (FavouritesItems)lvFavourites.SelectedItem;
sortedItems.Add(new FavouritesItems(item));
}
await SaveObjectToXml<list><favouritesitems>>(sortedItems, "favouritelistItems.xml");
MessageDialog msg = new MessageDialog("Favourites have been successfully saved to file");
await msg.ShowAsync();
}
catch (Exception ex)
{
MessageDialog msg = new MessageDialog("Unknown Error has occured: " + ex.ToString());
await msg.ShowAsync();
}
}</favouritesitems></list></favouritesitems>
What i had to do was add another constructor to my FavouritesItems Class (which is the object that is being added to the ListView.Items Item Collection)
This is my FavouritesItems Class:
public class FavouritesItems
{
private FavouritesItems selectedItem;
public string Section { get; set; }
public string Destination { get; set; }
public FavouritesItems(string section, string destination)
{
this.Section = section;
this.Destination = destination;
}
public FavouritesItems()
{
}
public FavouritesItems(FavouritesItems selectedItem)
{
this.Section = selectedItem.Section;
this.Destination = selectedItem.Destination;
}
}
Using this new constructor i was able to grab a COMPLETED item (both the section and destination are added seperately as strings, i.e ListView.Items.Add(new FavouritesItems("Sight-Seeing", "Melbourne"); etc) and was able to retrieve the attribute values specifically and seperately.
Considering all this was in a FOR loop, i was able to do this for each item in the list.. one at a time. By ensuring that the selectedIndex was equal to the FOR loop integer i.
Hopefully this helps anyone else that might have a similiar issue to mine when it comes to Windows Store Apps and using ListView's and their ItemCollections.
Note: i know the first code segment is kind of.. well oddly formatted.. not sure how to fix it. (posted code from visual studio into the tags and it ended up like it looks)