コード例 #1
0
 private void OnCurrentModifiedAppointmentChanged(AppointmentModifications newModifiedAppointment)
 {
     if (newModifiedAppointment == null || appointment != newModifiedAppointment.OriginalAppointment)
     {
         OperatingMode = OperatingMode.View;
         CurrentAppointmentModifications.PropertyChanged -= OnAppointmentModificationsPropertyChanged;
         appointmentModificationsVariable.StateChanged   -= OnCurrentModifiedAppointmentChanged;
     }
 }
コード例 #2
0
        private void OnDrop(object sender, DragEventArgs dragEventArgs)
        {
            if (dropIsPossible)
            {
                Time newBeginTime;
                Time newEndTime;

                CalculateCorrectAppointmentPosition(dragEventArgs, out newBeginTime, out newEndTime);

                AppointmentModifications.SetNewLocation(TherapyPlaceRowIdentifier, newBeginTime, newEndTime);
            }
        }
コード例 #3
0
        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();
        }
コード例 #4
0
        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;
        }
コード例 #5
0
        private void OnCurrentModifiedAppointmentVariableChanged(AppointmentModifications appointmentModifications)
        {
            ChangeConfirmationVisible = appointmentModifications != null;

            UpdateAddAppointmentPossible();
        }
コード例 #6
0
 private void OnAppointmentModificationsChanged(AppointmentModifications newAppointmentModifications)
 {
     AppointmentModifications = newAppointmentModifications;
 }
コード例 #7
0
 private void OnAppointmentModificationVariableChanged(AppointmentModifications appointmentModifications)
 {
     PracticeIsSelectable = appointmentModifications == null;
 }