コード例 #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 = 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);
                    });
                }
            }
        }
コード例 #2
0
        public void OpenPhoto()
        {
            if (CurrentContact == null)
            {
                return;
            }

            var photo = CurrentContact.Photo as TLUserProfilePhoto;

            if (photo != null)
            {
                StateService.CurrentPhoto   = photo;
                StateService.CurrentContact = CurrentContact;

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

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