I have a Windows 8 application with a ListView:
<ListView x:Name="EventListView" ItemClick="EventListView_ItemClick_1" IsItemClickEnabled="True"/>
There is some Event objects (a separate class with string attributes like EventType, Description, Time, etc..) that is the source of the ListView:
List<Event> eventlist = new List<Event>{
new Event(CONNECTION, "Disconnected", DateTime.Now.ToString(), MONITOR, "SAMSUNG M5", CONNECTION_IMG, RED),
new Event(SYNC, "Synchronised", DateTime.Now.ToString(), LAPTOP, "ASUS X402", SYNC_IMG, BLUE),
new Event(WARNING, "Overheated!", DateTime.Now.ToString(), PRINTER, "CANON MP280", WARING_IMG, YELLOW),
};
EventListView.ItemsSource = eventlist;
I tried to access the info of the clicked item, but its seems to be not set:
private void EventListView_ItemClick_1(object sender, ItemClickEventArgs e)
{
Event item = sender as Event;
GetInfoText.Text = item.Description.ToString();
}
How could I get the event attributes of the clicked item?