private void GetLoggedInUserDetails(string userid)
        {
            //GET LOGGED IN USER DETAILS
            _flickr.PeopleGetInfoAsync(userid, new Action<FlickrResult<Person>>(p =>
            {
                if (!p.HasError)
                {
                    flickr_Person = p.Result;
                    Dispatcher.RunAsync(
                        Windows.UI.Core.CoreDispatcherPriority.High,
                        new Windows.UI.Core.DispatchedHandler(() =>
                        {
                            //imgUser.Source = new BitmapImage(new Uri(p.Result.BuddyIconUrl));
                            //brdAvatar.Opacity = 1;

                            //lblName.Text = p.Result.UserName;

                            //spLogin.Visibility = Visibility.Collapsed;
                            //spLoggedIn.Visibility = Visibility.Visible;

                            //lblProject.Visibility = Visibility.Visible;
                        })
                        );
                }
            }));


            //GET LOGGED IN USERS PUBLIC PICTURES
            _flickr.PeopleGetPublicPhotosAsync(userid, new Action<FlickrResult<PhotoCollection>>(pc =>
            {
                if (!pc.HasError)
                {
                    PersonPhotos = pc.Result;


                    Dispatcher.RunAsync(
                        Windows.UI.Core.CoreDispatcherPriority.High,
                        new Windows.UI.Core.DispatchedHandler(() =>
                        {
                            //lbPhotos.ItemsSource = PersonPhotos;
                        })
                    );


                }
            }));

        }
Beispiel #2
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 }); }

        }