EventPage.xaml.cs CampusAppWP8::Pages::Events::EventPage CampusAppWP8::Pages::Events usingMicrosoft.Phone.Controls; usingMicrosoft.Phone.Tasks; usingSystem; usingSystem.Linq; usingSystem.Windows; usingSystem.Windows.Navigation; namespaceCampusAppWP8.Pages.Events { publicpartialclassEventPage:PhoneApplicationPage { privateboolisSourceSet=false; publicEventPage() { InitializeComponent(); } protectedoverridevoidOnNavigatedTo(NavigationEventArgse) { base.OnNavigatedTo(e); //SetpivotitemSource if(this.isSourceSet==false) { if((EventIndexPage.GetEventFeed.Model!=null) &&(EventIndexPage.GetEventFeed.Model.Channel!=null) &&(EventIndexPage.GetEventFeed.Model.Channel.Count()>=1)) { this.EventPivot.ItemsSource=EventIndexPage.GetEventFeed.Model.Channel[0].item; this.isSourceSet=true; } } stringpivotIndex=""; //Navigatetotheselectedpivotitem if(NavigationContext.QueryString.TryGetValue("pivotindex",outpivotIndex)) { intpivotIndexInt=int.Parse(pivotIndex); //iftheindexisintherangeofthearray if((pivotIndexInt>=0)&&(pivotIndexInt<EventIndexPage.GetEventFeed.Model.Channel[0].item.Count())) EventPivot.SelectedIndex=pivotIndexInt; else MessageBox.Show("ERROR:pivotIndexoutofrange!!!"); } } privatevoidEventHome_Click(objectsender,RoutedEventArgse) { //Navigatebacktotheeventindexpage NavigationService.GoBack(); } privatevoidEventLink_Click(objectsender,RoutedEventArgse) { FrameworkElementfe=senderasFrameworkElement; //Openthewebbrowser WebBrowserTaskwebBrowserTask=newWebBrowserTask(); webBrowserTask.Uri=newUri(fe.Tag.ToString(),UriKind.Absolute); webBrowserTask.Show(); } } }