private TraitViewModel(TraitViewModel parent, string text)
 {
     this._parent     = parent;
     this._isChecked  = false;
     this._isExpanded = true;
     this._text       = text;
     this.Children    = new ObservableCollection <TraitViewModel>();
 }
Esempio n. 2
0
        public TraitViewModel GetOrAdd(string text)
        {
            var index = this.Collection.BinarySearch(text, StringComparer.Ordinal, vm => vm.Text);

            if (index < 0)
            {
                var viewModel = new TraitViewModel(text);
                this.Collection.Insert(~index, viewModel);
                return(viewModel);
            }

            return(this.Collection[index]);
        }
Esempio n. 3
0
 private void OnExecuteTraitCheckedChanged(TraitViewModel trait)
 {
     this.searchQuery.TraitSet = this.traitCollectionView.GetCheckedTraits();
     FilterAfterDelay();
 }