private IssueMilestoneItemViewModel CreateItemViewModel(Milestone x)
 {
     var vm = new IssueMilestoneItemViewModel(x);
     vm.IsSelected = x.Number == Selected?.Number;
     vm.GoToCommand.Subscribe(_ => {
         Selected = vm.IsSelected ? x : null;
         SaveCommand.ExecuteIfCan();
     });
     return vm;
 }
        public IssueMilestonesViewModel(Func<Task<IReadOnlyList<Milestone>>> loadMilestones)
        {
            DismissCommand = ReactiveCommand.Create();

            var milestones = new ReactiveList<Milestone>();
            Milestones = milestones.CreateDerivedCollection(x => {
                var vm = new IssueMilestoneItemViewModel(x);
                vm.IsSelected = x.Number == Selected?.Number;
                vm.GoToCommand
                    .Select(_ => vm.IsSelected ? x : null)
                    .Subscribe(milestone =>  {
                        foreach (var a in Milestones.Where(y => y != vm))
                            a.IsSelected = false;
                        Selected = milestone;
                        DismissCommand.ExecuteIfCan();
                    });
                return vm;
            });

            LoadCommand = ReactiveCommand.CreateAsyncTask(async _ => {
                milestones.Reset(await loadMilestones());
            });
        }