public ChangesetBranchesViewModel(IApplicationService applicationService) { Branches = new ReactiveList <BranchModel>(); GoToBranchCommand = ReactiveCommand.Create(); GoToBranchCommand.OfType <BranchModel>().Subscribe(x => { var vm = CreateViewModel <ChangesetsViewModel>(); vm.RepositoryOwner = RepositoryOwner; vm.RepositoryName = RepositoryName; ShowViewModel(vm); }); LoadCommand = ReactiveCommand.CreateAsyncTask(t => Branches.SimpleCollectionLoad( applicationService.Client.Users[RepositoryOwner].Repositories[RepositoryName].GetBranches(), t as bool?)); }
public CommitBranchesViewModel(IApplicationService applicationService) { var branches = new ReactiveList <BranchModel>(); Branches = branches.CreateDerivedCollection( x => x, x => x.Name.ContainsKeyword(SearchKeyword), signalReset: this.WhenAnyValue(x => x.SearchKeyword)); GoToBranchCommand = ReactiveCommand.Create(); GoToBranchCommand.OfType <BranchModel>().Subscribe(x => { var vm = CreateViewModel <ChangesetsViewModel>(); vm.RepositoryOwner = RepositoryOwner; vm.RepositoryName = RepositoryName; vm.Branch = x.Name; ShowViewModel(vm); }); LoadCommand = ReactiveCommand.CreateAsyncTask(t => branches.LoadAll(applicationService.Client.Users[RepositoryOwner].Repositories[RepositoryName].GetBranches())); }