Exemple #1
0
        private async void RetrievePhotoDetails(Photo photo)
        {
            selectedPhoto = photo;
            //var dataToPass = new List<KeyValuePair<string, object>>();

            //dataToPass.Add(new KeyValuePair<string, object>("Title", photo.Title));
            //dataToPass.Add(new KeyValuePair<string, object>("ThumbnailUrl", photo.ThumbnailUrl));
            //dataToPass.Add(new KeyValuePair<string, object>("LargeUrl", photo.LargeUrl));
            //dataToPass.Add(new KeyValuePair<string, object>("Medium640Url", photo.Medium640Url));
            //dataToPass.Add(new KeyValuePair<string, object>("MediumUrl", photo.MediumUrl));
            //dataToPass.Add(new KeyValuePair<string, object>("SmallUrl", photo.SmallUrl));
            //dataToPass.Add(new KeyValuePair<string, object>("IconServer", photo.IconServer));
            //dataToPass.Add(new KeyValuePair<string, object>("Server", photo.Server));
            //dataToPass.Add(new KeyValuePair<string, object>("IconFarm", photo.IconFarm));
            //dataToPass.Add(new KeyValuePair<string, object>("Farm", photo.Farm));
            //dataToPass.Add(new KeyValuePair<string, object>("PhotoId", photo.PhotoId));

            //await MakeUWPCommandCall("LoadFlickrPhoto", "Call", dataToPass);


            //note : amazingly mvvmlight message bus works perfectly with extensions talking to the host
            Messenger.Default.Send(new LoadPhoto()
            {
                Photo = photo
            });

            var foundUser = await _flickr.PeopleGetInfoAsync(photo.UserId);

            if (!foundUser.HasError)
            {
                photoUser = foundUser.Result;  Messenger.Default.Send(new LoadPhotoUser()
                {
                    User = photoUser
                });
            }

            var foundComments = await _flickr.PhotosCommentsGetListAsync(photo.PhotoId);

            if (!foundComments.HasError)
            {
                photoComments = foundComments.Result; Messenger.Default.Send(new LoadPhotoComments()
                {
                    Comments = photoComments
                });
            }
        }