public CommitCommentViewModel(IApplicationService applicationService, IImgurService imgurService, IMediaPickerFactory mediaPicker, IAlertDialogFactory alertDialogFactory) : base(imgurService, mediaPicker, alertDialogFactory) { SaveCommand = ReactiveCommand.CreateAsyncTask( this.WhenAnyValue(x => x.Text).Select(x => !string.IsNullOrEmpty(x)), t => { var commitComment = new Octokit.NewCommitComment(Text); return(applicationService.GitHubClient.Repository.RepositoryComments.Create(RepositoryOwner, RepositoryName, Node, commitComment)); }); SaveCommand.Subscribe(x => Dismiss()); }
private void ShowCommentComposer(int line) { ShowComposer(async text => { var commentOptions = new Octokit.NewCommitComment(text) { Path = _path, Position = line }; var comment = await _applicationService.GitHubClient.Repository.Comment.Create( _username, _repository, _commit, commentOptions); _comments.Add(comment); }); }