private static string GenerateShareMessage(object sender) { MenuItem mi = sender as MenuItem; if (mi != null) { ContextMenu cm = mi.Parent as ContextMenu; PerformanceInfo pi = (PerformanceInfo)cm.Tag; return(String.Format("Shall we go and see \"{0}\" at Cineworld {1} on {2} at {3}? Book here {4}", (string)pi.FilmTitle, SelectedCinema.Name, DateTimeToStringConverter.ConvertData(pi.PerformanceTS), pi.TimeString, (pi.BookUrl).ToString())); } return(String.Empty); }
protected async override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { base.OnNavigatedTo(e); this.abibAddFav = new ApplicationBarIconButton() { Text = "favourite", IconUri = new Uri("/Images/appbar.favs.addto.rest.png", UriKind.Relative) }; this.abibAddFav.Click += this.btnFavourite_Click; this.abibRemFav = new ApplicationBarIconButton() { Text = "unfavourite", IconUri = new Uri("/Images/appbar.favs.rem.rest.png", UriKind.Relative) }; this.abibRemFav.Click += this.btnUnfavourite_Click; this.abibPin = new ApplicationBarIconButton() { Text = "pin", IconUri = new Uri("/Images/appbar.pin.png", UriKind.Relative) }; this.abibPin.Click += this.btnPinSecondary_Click; this.abibDirections = new ApplicationBarIconButton() { Text = "drive", IconUri = new Uri("/Images/route.png", UriKind.Relative) }; this.abibDirections.Click += this.btnDrive_Click; this.abibTrailer = new ApplicationBarIconButton() { Text = "trailer", IconUri = new Uri("/Images/appbar.transport.play.rest.png", UriKind.Relative) }; this.abibTrailer.Click += this.btnViewTrailer_Click; this.abibShare = new ApplicationBarIconButton() { Text = "share", IconUri = new Uri("/Images/appbar.share03.png", UriKind.Relative) }; this.abibShare.Click += this.btnShare_Click; this.abibSoundTrack = new ApplicationBarIconButton() { IconUri = new Uri("/Images/appbar.notes.rest.png", UriKind.Relative), Text = "sounds track" }; this.abibSoundTrack.Click += this.abibSoundTrack_Click; this.ApplicationBar.Buttons.Clear(); if (!Config.ShowCleanBackground && SelectedFilm.BackdropUrl != null) { this.pMain.Background = new ImageBrush() { ImageSource = new BitmapImage(SelectedFilm.BackdropUrl), Opacity = 0.2, Stretch = Stretch.UniformToFill }; } this.pMain.Title = String.Format("{0} at Cineworld {1}", SelectedFilm.TitleWithClassification, SelectedCinema.Name); bool bError = false; try { this.DataContext = this; if (ShowCinemaDetails) { await this.LoadCinemaDetails(); } if (ShowFilmDetails) { this.LoadFilmDetails(); } var query = from item in SelectedFilm.Performances orderby((PerformanceInfo)item).PerformanceTS group item by((PerformanceInfo)item).PerformanceTS.Date into g select new Group <PerformanceInfo>(DateTimeToStringConverter.ConvertData(g.Key.Date), g); List <Group <PerformanceInfo> > shows = new List <Group <PerformanceInfo> >(query); this.lbPerformances.ItemsSource = shows; } catch { bError = true; } if (bError) { MessageBox.Show("Error downloading showtime data"); } }