private void NewAffix() { var vm = new EditAffixViewModel(_projectService.Project.Segmenter); if (_dialogService.ShowModalDialog(this, vm) == true) { var affix = new Affix(vm.StrRep, vm.Type == AffixViewModelType.Prefix ? AffixType.Prefix : AffixType.Suffix, vm.Category); _projectService.Project.Segmenter.Segment(affix); DomainVariety.Affixes.Add(affix); Messenger.Default.Send(new DomainModelChangedMessage(false)); SelectedAffix = _affixes.Single(a => a.DomainAffix == affix); } }
private void AddNewMeaning() { var vm = new EditMeaningViewModel(_projectService.Project.Meanings); if (_dialogService.ShowModalDialog(this, vm) == true) { var newMeaning = new Meaning(vm.Gloss, vm.Category); _projectService.Project.Meanings.Add(newMeaning); Messenger.Default.Send(new DomainModelChangedMessage(true)); SelectedMeaning = _meanings.Single(s => s.DomainMeaning == newMeaning); } }