Exemplo n.º 1
0
        private async void LoadPhotos()
        {
            loading.Visibility = Visibility.Visible;
            retry.Visibility   = Visibility.Collapsed;
            try
            {
                var photos = await FlickrPhoto.Load("people");

                loading.Visibility = Visibility.Collapsed;
                this.DataContext   = photos;
            }
            catch
            {
                var dialog = new Windows.UI.Popups.MessageDialog(Strings.DownloadFlickrErrorMessage);
                dialog.ShowAsync();
                retry.Visibility   = Visibility.Visible;
                loading.Visibility = Visibility.Collapsed;
            }
            splitView.IsPaneOpen = true;
        }
        private async void LoadContent()
        {
            sv.Visibility      = Visibility.Collapsed;
            loading.Visibility = Visibility.Visible;
            retry.Visibility   = Visibility.Collapsed;
            try
            {
                foreach (C1Tile tile in tilePanel.Children)
                {
                    var content = await FlickrPhoto.Load((string)tile.Header);

                    loading.Visibility = Visibility.Collapsed;
                    sv.Visibility      = Visibility.Visible;
                    tile.ContentSource = content;
                }
            }
            catch
            {
                var dialog = new Windows.UI.Popups.MessageDialog(Strings.DownloadFlickrErrorMessage);
                dialog.ShowAsync();
                retry.Visibility   = Visibility.Visible;
                loading.Visibility = Visibility.Collapsed;
            }
        }