Пример #1
0
        private void ConfigureAddCommand()
        {
            var canAdd = this.WhenAny(x => x.Adding, x => x.Complete, (a, c) => !a.Value && !c.Value);

            AddCommand = ReactiveCommand.CreateFromTask(async() =>
            {
                ItemTreshold = -1;
                return(await _cacheService.LoadNextPullRequests());
            }, canAdd);
            AddCommand.IsExecuting.ToPropertyEx(this, x => x.Adding);
            AddCommand.ThrownExceptions.SelectMany(ex => ExceptionInteraction.Handle(ex)).Subscribe();
            AddCommand.Where(x => x != null && x.Any())
            .Do(async api => await AddPullRequest(api))
            .Subscribe();
        }