예제 #1
0
 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();
     }
 }
예제 #2
0
        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());
        }