public PackageCategoryTreeItem(UserPackageSelectionStore store, string name,
                                       ObservableCollection <PackageMenuItem> items)
        {
            _store = store;
            Name   = name;
            Items  = items;

            _bag.Add(_store.SelectedPackages()
                     .Map(pkgs => Items.All(x => pkgs.ContainsKey(x.Key)))
                     .DistinctUntilChanged()
                     .SubscribeOn(PahkatApp.Current.Dispatcher)
                     .Subscribe(x => {
                _isGroupSelected = x;
                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("IsGroupSelected"));
            }));
        }
 private IDisposable BindPrimaryButtonLabel(IMainPageView view, UserPackageSelectionStore store)
 {
     // Can't use distinct until changed here because HashSet is never reset
     return(store.SelectedPackages()
            .Subscribe(GeneratePrimaryButtonLabel));
 }