public WordCountViewModel(string languageId, PhraseTranslator translator) { _languageId = languageId; _translator = translator; // Preserve character case for German (and potentially other languages in the future). _ignoreCase = _languageId != "de"; CountNGramsCommand = new RelayCommand(CountNGrams, Can_CountNGrams); CountWordsCommand = new RelayCommand(CountWords, Can_CountWords); SortNGramsCommand = new RelayCommand(SortNGrams, Can_SortNGrams); }
public MainViewModel() { LanguageIds = Array.AsReadOnly(new[] { "de", "es", "fr", "ru" }); Translator = new PhraseTranslator(); CreatePhraseCommand = new RelayCommand(CreatePhrase, Can_CreatePhrase); DeletePhraseCommand = new RelayCommand(DeletePhrase, Can_DeletePhrase); IgnoreWordCommand = new RelayCommand(IgnoreWord, Can_IgnoreWord); LookupWordCommand = new RelayCommand(LookupWord, Can_LookupWord); SavePhraseCommand = new RelayCommand(SavePhrase, Can_SavePhrase); UnignoreWordCommand = new RelayCommand(UnignoreWord, Can_UnignoreWord); AddClusterCommand = new RelayCommand(AddCluster, Can_AddCluster); AddPhraseCommand = new RelayCommand(AddPhrase, Can_AddPhrase); DeleteClusterCommand = new RelayCommand(DeleteCluster, Can_DeleteCluster); AddToClusterCommand = new RelayCommand(AddToCluster, Can_AddToCluster); }
private void loadPhraseTranslations(string path) { Translator = new PhraseTranslator(); Translator.LoadPhraseData(path); OnPropertyChanged("Translator"); OnPropertyChanged("IgnoredWords"); OnPropertyChanged("WordClusters"); }