Exemplo n.º 1
0
        private IssueItemViewModel CreateItemViewModel(Issue issue)
        {
            var item = new IssueItemViewModel(issue);

            if (item.IsPullRequest)
            {
                item.GoToCommand.Subscribe(_ => {
                    var vm = this.CreateViewModel <PullRequestViewModel>();
                    vm.Init(item.RepositoryOwner, item.RepositoryName, item.Number, issue: issue);
                    vm.IssueUpdated.Subscribe(x => UpdateIssue(x));
                    NavigateTo(vm);
                });
            }
            else
            {
                item.GoToCommand.Subscribe(_ => {
                    var vm = this.CreateViewModel <IssueViewModel>();
                    vm.Init(item.RepositoryOwner, item.RepositoryName, item.Number, issue);
                    vm.IssueUpdated.Subscribe(x => UpdateIssue(x));
                    NavigateTo(vm);
                });
            }

            return(item);
        }
Exemplo n.º 2
0
        private IssueItemViewModel CreateItemViewModel(IssueModel issue)
        {
            var item = new IssueItemViewModel(issue);

            if (item.IsPullRequest)
            {
                item.GoToCommand.Subscribe(_ =>
                {
                    var vm             = this.CreateViewModel <PullRequestViewModel>();
                    vm.RepositoryOwner = item.RepositoryOwner;
                    vm.RepositoryName  = item.RepositoryName;
                    vm.Id = item.Number;
                    NavigateTo(vm);
                });
            }
            else
            {
                item.GoToCommand.Subscribe(_ =>
                {
                    var vm             = this.CreateViewModel <IssueViewModel>();
                    vm.RepositoryOwner = item.RepositoryOwner;
                    vm.RepositoryName  = item.RepositoryName;
                    vm.Id = item.Number;
                    NavigateTo(vm);
                });
            }

            return(item);
        }
Exemplo n.º 3
0
        private IssueItemViewModel CreateItemViewModel(IssueModel issue)
        {
            var item = new IssueItemViewModel(issue);
            if (item.IsPullRequest)
            {
                item.GoToCommand.Subscribe(_ => {
                    var vm = this.CreateViewModel<PullRequestViewModel>();
                    vm.Init(item.RepositoryOwner, item.RepositoryName, item.Number);
                    vm.IssueUpdated.Subscribe(x => UpdateIssue(x));
                    NavigateTo(vm);
                });
            }
            else
            {
                item.GoToCommand.Subscribe(_ => {
                    var vm = this.CreateViewModel<IssueViewModel>();
                    vm.Init(item.RepositoryOwner, item.RepositoryName, item.Number);
                    vm.IssueUpdated.Subscribe(x => UpdateIssue(x));
                    NavigateTo(vm);
                });
            }

            return item;
        }