示例#1
0
        public TherapyPlaceRowViewModel(IViewModelCommunication viewModelCommunication,
                                        IClientTherapyPlaceTypeRepository therapyPlaceTypeRepository,
                                        TherapyPlace therapyPlace,
                                        Color roomDisplayColor,
                                        TherapyPlaceRowIdentifier identifier,
                                        AdornerControl adornerControl,
                                        Time timeSlotBegin,
                                        Time timeSlotEnd,
                                        ISharedStateReadOnly <AppointmentModifications> appointmentModificationsVariable,
                                        Width initialGridWidth,
                                        Action <string> errorCallback)
        {
            this.viewModelCommunication     = viewModelCommunication;
            this.therapyPlaceTypeRepository = therapyPlaceTypeRepository;
            this.therapyPlace = therapyPlace;
            this.appointmentModificationsVariable = appointmentModificationsVariable;

            therapyPlaceTypeRepository.UpdatedTherapyPlaceTypeAvailable += OnUpdatedTherapyPlaceTypeAvailable;

            IsVisible             = true;
            RoomColor             = roomDisplayColor;
            Identifier            = identifier;
            TherapyPlaceName      = therapyPlace.Name;
            AppointmentViewModels = new ObservableCollection <IAppointmentViewModel>();

            viewModelCommunication.RegisterViewModelAtCollection <ITherapyPlaceRowViewModel, TherapyPlaceRowIdentifier>(
                Constants.ViewModelCollections.TherapyPlaceRowViewModelCollection,
                this
                );

            appointmentModificationsVariable.StateChanged += OnAppointmentModificationsChanged;
            OnAppointmentModificationsChanged(appointmentModificationsVariable.Value);

            TimeSlotBegin = timeSlotBegin;
            TimeSlotEnd   = timeSlotEnd;

            AdornerControl = adornerControl;

            GridWidth = initialGridWidth;

            therapyPlaceTypeRepository.RequestTherapyPlaceTypes(
                placeType =>
            {
                Application.Current.Dispatcher.Invoke(() =>
                {
                    PlaceTypeIcon = GetIconForTherapyPlaceType(placeType.IconType);
                });
            },
                therapyPlace.TypeId,
                errorCallback
                );
        }
        public TherapyPlaceRowViewModelBuilder(IViewModelCommunication viewModelCommunication,
                                               IClientMedicalPracticeRepository medicalPracticeRepository,
                                               IClientTherapyPlaceTypeRepository therapyPlaceTypeRepository,
                                               AdornerControl adornerControl,
                                               ISharedStateReadOnly <AppointmentModifications> appointmentModificationsVariable,
                                               ISharedStateReadOnly <Size> appointmentGridSizeVariable)
        {
            this.viewModelCommunication     = viewModelCommunication;
            this.medicalPracticeRepository  = medicalPracticeRepository;
            this.therapyPlaceTypeRepository = therapyPlaceTypeRepository;

            this.adornerControl = adornerControl;
            this.appointmentModificationsVariable = appointmentModificationsVariable;
            this.appointmentGridSizeVariable      = appointmentGridSizeVariable;
        }
示例#3
0
 public MainWindowBuilder(ILocalSettingsRepository localSettingsRepository,
                          IClientPatientRepository patientRepository,
                          IClientMedicalPracticeRepository medicalPracticeRepository,
                          IClientReadModelRepository readModelRepository,
                          IClientTherapyPlaceTypeRepository therapyPlaceTypeRepository,
                          IClientLabelRepository labelRepository,
                          ICommandService commandService,
                          IViewModelCommunication viewModelCommunication,
                          ISession session,
                          Action <string> errorCallback)
 {
     this.localSettingsRepository    = localSettingsRepository;
     this.patientRepository          = patientRepository;
     this.medicalPracticeRepository  = medicalPracticeRepository;
     this.readModelRepository        = readModelRepository;
     this.therapyPlaceTypeRepository = therapyPlaceTypeRepository;
     this.labelRepository            = labelRepository;
     this.commandService             = commandService;
     this.viewModelCommunication     = viewModelCommunication;
     this.session       = session;
     this.errorCallback = errorCallback;
 }
 public MainViewModelBuilder(IClientMedicalPracticeRepository medicalPracticeRepository,
                             IClientReadModelRepository readModelRepository,
                             IClientPatientRepository patientRepository,
                             IClientTherapyPlaceTypeRepository therapyPlaceTypeRepository,
                             IClientLabelRepository labelRepository,
                             ICommandService commandService,
                             ILocalSettingsRepository localSettingsRepository,
                             IViewModelCommunication viewModelCommunication,
                             ISession session,
                             AdornerControl adornerControl)
 {
     this.medicalPracticeRepository  = medicalPracticeRepository;
     this.readModelRepository        = readModelRepository;
     this.patientRepository          = patientRepository;
     this.therapyPlaceTypeRepository = therapyPlaceTypeRepository;
     this.labelRepository            = labelRepository;
     this.commandService             = commandService;
     this.localSettingsRepository    = localSettingsRepository;
     this.viewModelCommunication     = viewModelCommunication;
     this.session        = session;
     this.adornerControl = adornerControl;
 }