public EditNaturalClassViewModel(FeatureSystem featSys, IEnumerable<SoundClass> soundClasses) : base("New Feature-based Class", soundClasses) { _availableFeatures = new BindableList<FeatureViewModel>(featSys.OfType<SymbolicFeature>().Select(f => new FeatureViewModel(f))); _activeFeatures = new BindableList<FeatureViewModel>(); _addCommand = new RelayCommand(AddFeature, CanAddFeature); _removeCommand = new RelayCommand(RemoveFeature, CanRemoveFeature); }
public EditNaturalClassViewModel(FeatureSystem featSys, IEnumerable <SoundClass> soundClasses) : base("New Feature-based Class", soundClasses) { _availableFeatures = new BindableList <FeatureViewModel>(featSys.OfType <SymbolicFeature>().Select(f => new FeatureViewModel(f))); _activeFeatures = new BindableList <FeatureViewModel>(); _addCommand = new RelayCommand(AddFeature, CanAddFeature); _removeCommand = new RelayCommand(RemoveFeature, CanRemoveFeature); }
public EditNaturalClassViewModel(FeatureSystem featSys, IEnumerable<SoundClass> soundClasses, NaturalClass naturalClass) : base("Edit Feature-based Class", soundClasses, naturalClass) { _type = naturalClass.Type == CogFeatureSystem.ConsonantType ? SoundType.Consonant : SoundType.Vowel; _availableFeatures = new BindableList<FeatureViewModel>(); _activeFeatures = new BindableList<FeatureViewModel>(); foreach (SymbolicFeature feature in featSys.OfType<SymbolicFeature>()) { SymbolicFeatureValue sfv; if (naturalClass.FeatureStruct.TryGetValue(feature, out sfv)) _activeFeatures.Add(new FeatureViewModel(feature, (FeatureSymbol) sfv)); else _availableFeatures.Add(new FeatureViewModel(feature)); } _addCommand = new RelayCommand(AddFeature, CanAddFeature); _removeCommand = new RelayCommand(RemoveFeature, CanRemoveFeature); }
public EditNaturalClassViewModel(FeatureSystem featSys, IEnumerable <SoundClass> soundClasses, NaturalClass naturalClass) : base("Edit Feature-based Class", soundClasses, naturalClass) { _type = naturalClass.Type == CogFeatureSystem.ConsonantType ? SoundType.Consonant : SoundType.Vowel; _availableFeatures = new BindableList <FeatureViewModel>(); _activeFeatures = new BindableList <FeatureViewModel>(); foreach (SymbolicFeature feature in featSys.OfType <SymbolicFeature>()) { SymbolicFeatureValue sfv; if (naturalClass.FeatureStruct.TryGetValue(feature, out sfv)) { _activeFeatures.Add(new FeatureViewModel(feature, (FeatureSymbol)sfv)); } else { _availableFeatures.Add(new FeatureViewModel(feature)); } } _addCommand = new RelayCommand(AddFeature, CanAddFeature); _removeCommand = new RelayCommand(RemoveFeature, CanRemoveFeature); }