Beispiel #1
0
        public void OpenPhoto()
        {
            var user = CurrentItem;

            if (user != null)
            {
                var photo = user.Photo as TLUserProfilePhoto;
                if (photo != null)
                {
                    StateService.CurrentPhoto   = photo;
                    StateService.CurrentContact = user;
                    NavigationService.UriFor <ProfilePhotoViewerViewModel>().Navigate();
                    return;
                }

                var photoEmpty = user.Photo as TLUserProfilePhotoEmpty;
                if (photoEmpty != null)
                {
                    EditCurrentUserActions.EditPhoto(result =>
                    {
                        var fileId = TLLong.Random();
                        IsWorking  = true;
                        UploadManager.UploadFile(fileId, new TLUserSelf(), result);
                    });
                }
            }
        }
Beispiel #2
0
        public void OpenPhoto()
        {
            var user = CurrentItem;

            if (user != null)
            {
                var photo = user.Photo as TLUserProfilePhoto;
                if (photo != null)
                {
                    StateService.CurrentPhoto   = photo;
                    StateService.CurrentContact = CurrentItem;

                    if (ProfilePhotoViewer == null)
                    {
                        ProfilePhotoViewer = new ProfilePhotoViewerViewModel(StateService, MTProtoService);
                        NotifyOfPropertyChange(() => ProfilePhotoViewer);
                    }

                    BeginOnUIThread(() => ProfilePhotoViewer.OpenViewer());
                }

                var photoEmpty = user.Photo as TLUserProfilePhotoEmpty;
                if (photoEmpty != null)
                {
                    EditCurrentUserActions.EditPhoto(result =>
                    {
                        var fileId = TLLong.Random();
                        IsWorking  = true;
                        UploadManager.UploadFile(fileId, new TLUser66 {
                            IsSelf = true
                        }, result);
                    });
                }
            }
        }
Beispiel #3
0
 public void EditProfilePhoto()
 {
     EditCurrentUserActions.EditPhoto(photo =>
     {
         var fileId = TLLong.Random();
         IsWorking  = true;
         UploadManager.UploadFile(fileId, new TLUserSelf(), photo);
     });
 }