Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        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);
        }