I have a custom listbox. Some of the collections's items have fields "name", "text", "image" and "url". Other may have other fields (a use a template selector). So, if item has fields "name", "text", "url" and "image" - it shows in listbox as 2 textblocks and 1 image. When I tap on the image - program must open new window, open webBrowser and go to url wich is in the item's property "url". I understand how to transmit info from one page to other, but i cant understand how to get the "url" from item. I tried
private void Video_Tap(object sender, GestureEventArgs e) // event when tap on the image
{
New tmp = ((sender as ListBox).SelectedItem as New); // New - is the type of collection's item
string vid = tmp.Video.url; // Video has fields "image" and "url"
string destination = string.Format("/Video_Page.xaml?uri={0}", vid );
NavigationService.Navigate(new Uri(destination, UriKind.Relative));
}
but sender has an image type.