Пример #1
0
        /// <summary>
        /// Called once Flickr has the photo metadata available for us
        /// </summary>
        /// <param name="photo"></param>
        /// <param name="o"></param>
        private void PhotoReadyHandler(FlickrPhoto photo, CarouselInteractiveVisual3D visual3D)
        {
            if (photo != null  && RequestStillValid(visual3D.Row, visual3D.Column, visual3D.Index))
            {
                visual3D.Photo = photo;

                BitmapImage b = new BitmapImage(new Uri(photo.URL_Small));
                _bitmapToGeometry[b] = visual3D;

                if (b.IsDownloading)
                {
                    b.DownloadCompleted += new EventHandler(ImageLoadCompleted);
                }
                else
                {
                    ImageLoadCompleted(b, null);
                }
            }
        }
Пример #2
0
        protected override void RequestVisual3D(int index, int row, int col)
        {
            // create the visual3D to return
            CarouselInteractiveVisual3D visual3D = new CarouselInteractiveVisual3D(this, row, col, index);
            visual3D.Geometry = meshGeometry;

            // make an asynch call to flickr to get the photo information we're interested in
            Flickr.AsynchGetPhoto(Data, index, visual3D.Dispatcher,
                                  delegate(object o)
                                  {
                                      PhotoReadyHandler((FlickrPhoto)o, visual3D);
                                  });
        }