private async void refreshPage()
        {
            loadingBar.Visibility = Visibility.Visible;
            eventBar.Visibility = Visibility.Visible;
            try
            {
                currentArtist = await getDetails(selectedArtist);

                bioBlock.Text = currentArtist.bio.content;


                BitmapImage image = new BitmapImage(new Uri(currentArtist.image[4].url));
                (LayoutGrid.Resources["imageOutTransition"] as Storyboard).Begin();
                App.Current.Resources["GlobalBackgroundImage"] = image;
                backgroundImageBox.Source = image;
                (LayoutGrid.Resources["imageInTransition"] as Storyboard).Begin();


                artistListView.ItemsSource = currentArtist.similar.artist;
                loadingBar.Visibility = Visibility.Collapsed;

                artistGigs = (await getGigs(selectedArtist));
                if (artistGigs == null)
                {
                    noBlock.Visibility = Visibility.Visible;
                }
                else
                {
                    itemListView.ItemsSource = artistGigs.events.gigs;
                }
                eventBar.Visibility = Visibility.Collapsed;
            }
            catch (HttpRequestException ex)
            {
                MessageDialog md = new MessageDialog("We could not load the artist information. Check your connection!");
                md.ShowAsync();
                eventBar.Visibility = Visibility.Collapsed;
                loadingBar.Visibility = Visibility.Collapsed;
            }
            catch (Exception)
            {
                MessageDialog md = new MessageDialog("There was a problem with the artist infomration. Sorry!");
                md.ShowAsync();
                eventBar.Visibility = Visibility.Collapsed;
                loadingBar.Visibility = Visibility.Collapsed;
            }
            


        }
示例#2
0
        public static void fixDates(Gigs gig)
        {
            foreach (Gig g in gig.events.gigs)
            {
                string date = g.startDate;
                g.day = date.Substring(5, 2);
                g.month = date.Substring(8, 3);
                g.year = date.Substring(12, 4);

            }
        }