private void OnCurrentModifiedAppointmentChanged(AppointmentModifications newModifiedAppointment) { if (newModifiedAppointment == null || appointment != newModifiedAppointment.OriginalAppointment) { OperatingMode = OperatingMode.View; CurrentAppointmentModifications.PropertyChanged -= OnAppointmentModificationsPropertyChanged; appointmentModificationsVariable.StateChanged -= OnCurrentModifiedAppointmentChanged; } }
private void OnDrop(object sender, DragEventArgs dragEventArgs) { if (dropIsPossible) { Time newBeginTime; Time newEndTime; CalculateCorrectAppointmentPosition(dragEventArgs, out newBeginTime, out newEndTime); AppointmentModifications.SetNewLocation(TherapyPlaceRowIdentifier, newBeginTime, newEndTime); } }
private void OnAppointmentModificationsVariableChanged(AppointmentModifications newAppointmentModifications) { if (newAppointmentModifications == null) { currentButtonMode = ButtonMode.ViewMode; } else { currentButtonMode = ButtonMode.StartOfEditMode; currentAppointmentModifications = newAppointmentModifications; currentAppointmentModifications.PropertyChanged += OnCurrentAppointmentModificationsChanged; } ((Command)Undo).RaiseCanExecuteChanged(); ((Command)Redo).RaiseCanExecuteChanged(); }
public UndoRedoViewModel(IViewModelCommunication viewModelCommunication, ISharedState <AppointmentModifications> appointmentModificationsVariable, ISession session, Action <string> errorCallback) { this.viewModelCommunication = viewModelCommunication; this.appointmentModificationsVariable = appointmentModificationsVariable; this.session = session; this.errorCallback = errorCallback; currentButtonMode = ButtonMode.ViewMode; currentAppointmentModifications = null; Undo = new Command(UndoAction, UndoPossible); Redo = new Command(RedoAction, RedoPossible); appointmentModificationsVariable.StateChanged += OnAppointmentModificationsVariableChanged; session.UndoPossibleChanged += OnUndoPossibleChanged; session.RedoPossibleChanged += OnRedoPossibleChanged; }
private void OnCurrentModifiedAppointmentVariableChanged(AppointmentModifications appointmentModifications) { ChangeConfirmationVisible = appointmentModifications != null; UpdateAddAppointmentPossible(); }
private void OnAppointmentModificationsChanged(AppointmentModifications newAppointmentModifications) { AppointmentModifications = newAppointmentModifications; }
private void OnAppointmentModificationVariableChanged(AppointmentModifications appointmentModifications) { PracticeIsSelectable = appointmentModifications == null; }