private void EditDictionary(object param) { DictionaryEditWindow target = new DictionaryEditWindow((Dictionary)((DataGrid)param).SelectedItem) { Owner = this.SourceWindow }; SwitchWindows(target, true); this.DictionaryList = ReloadDictionaryList(); }
public DictionaryViewModel(DictionaryEditWindow dictionaryEditWindow, Dictionary SelectedDictionary) { this.SelectedDictionary = SelectedDictionary; this.SourceWindow = dictionaryEditWindow; this.SaveCommand = new RelayCommand(SaveDictionary, CanExecute); this._contextDal = new DictionaryDAL(); this.DictionaryTypeList = new ObservableCollection <DictionaryType>(((DictionaryDAL)_contextDal).DictionaryTypeList()); IsProtected = SelectedDictionary.IsProtected; EditAble = SelectedDictionary.ID == 0; }
private void CreateDictionary() { Dictionary dictionary = new Dictionary(); DictionaryEditWindow target = new DictionaryEditWindow(dictionary) { Owner = this.SourceWindow }; SwitchWindows(target, true); this.DictionaryList = ReloadDictionaryList(); }