コード例 #1
0
ファイル: RelevantFeatureViewModel.cs プロジェクト: rmunn/cog
        public RelevantFeatureViewModel(SymbolicFeature feature, int weight, bool vowel, bool consonant, IReadOnlyDictionary<FeatureSymbol, int> valueMetrics)
        {
            _feature = feature;
            _weight = weight;
            _vowel = vowel;
            _consonant = consonant;

            var values = new List<RelevantValueViewModel>();
            foreach (FeatureSymbol symbol in feature.PossibleSymbols)
            {
                var vm = new RelevantValueViewModel(symbol, valueMetrics[symbol]);
                vm.PropertyChanged += ChildPropertyChanged;
                values.Add(vm);
            }
            _values = new ReadOnlyList<RelevantValueViewModel>(values);
        }
コード例 #2
0
        public RelevantFeatureViewModel(SymbolicFeature feature, int weight, bool vowel, bool consonant, IReadOnlyDictionary <FeatureSymbol, int> valueMetrics)
        {
            _feature   = feature;
            _weight    = weight;
            _vowel     = vowel;
            _consonant = consonant;

            var values = new List <RelevantValueViewModel>();

            foreach (FeatureSymbol symbol in feature.PossibleSymbols)
            {
                var vm = new RelevantValueViewModel(symbol, valueMetrics[symbol]);
                vm.PropertyChanged += ChildPropertyChanged;
                values.Add(vm);
            }
            _values = new ReadOnlyList <RelevantValueViewModel>(values);
        }