private void SaveDictionary() { if (CurrentOptions.CurrentUser != null) { DictionaryViewModel newDictionary = new DictionaryViewModel(); newDictionary.Name = _newDictionary.Name; newDictionary.DictionaryID = _newDictionary.DictionaryID; Dictionaries.Add(newDictionary); _dao.addDictionary(newDictionary.getDictionary()); NewDictionary = new DictionaryViewModel(); } }
public DictionaryListViewModel() { #if DEBUG if (DesignerProperties.GetIsInDesignMode(new DependencyObject())) { return; } #endif _wordInsertViewModel = new WordInsertViewModel(); _dictionaries = new ObservableCollection <DictionaryViewModel>(); _dao = (IDAO)LateBinding.GetDAOConstructor().Invoke(new object[] { }); GetAllDictionaries(); NewDictionary = new DictionaryViewModel(); _saveNewDictionaryCommand = new RelayCommand(param => this.SaveDictionary()); }