public new void Save() { //IsBusy = true; _isSaving = true; base.Save(); if (Error != null) { MessageBox.Show(Error.Message, "SaveError".GetUiTranslation(), MessageBoxButtons.OK, MessageBoxIcon.Error); return; } _refreshDateTime = DateTime.Now; if (_parent != null) { _parent.ListItemId = Model.RegisterId; } if (ViewNamedElements != null) { ViewModelBinder.RebindProperties(this); } NotifyOfPropertyChange("Audit"); SetReadOnlyButtons(); _isSaving = false; //IsBusy = false; ParentViewModel.AutoRefreshDocuments(); }
private void BindStudentEdit() { // clear old bindings BindingManager.Bindings.Clear(); // bind to main form properties BindMenuItem("CanSaveStudent", "CanSave"); BindMenuItem("CanCreateNewStudent", "CanCreateNew"); BindMenuItem("CanDeleteStudent", "CanDelete"); BindMenuItem("CanCloseStudent", "CanClose"); CanCreateNew = true; CanSave = false; CanDelete = false; CanClose = false; if (_model != null && _model.StudentEdit != null) { // set new bindings for this object BindingManager.Bindings.Add(new Binding(this, "CanCreateNew", _model.StudentEdit, "IsDirty") { Converter = new InverseBooleanConverter(), Mode = BindingMode.OneWayToTarget }); BindingManager.Bindings.Add(new Binding(this, "CanSave", _model.StudentEdit, "IsSavable") { Mode = BindingMode.OneWayToTarget }); CanDelete = true; CanClose = true; // we need to rebind just because of FullName if (ViewNamedElements != null) { ViewModelBinder.RebindProperties(this); } } }