Esempio n. 1
0
 /// <summary>
 /// Creates the command factory helper.
 /// </summary>
 /// <param name="commandFactory">The command factory.</param>
 /// <returns>A <see cref="Rem.Ria.Infrastructure.Commands.ICommandFactoryHelper"/></returns>
 protected override ICommandFactoryHelper CreateCommandFactoryHelper(ICommandFactory commandFactory)
 {
     return(CommandFactoryHelper.CreateHelper(this, commandFactory));
 }
        public ClinicianScheduleTileViewModel(
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IUserDialogService userDialogService,
            IEventAggregator eventAggregator,
            IAccessControlManager accessControlManager,
            INotificationService notificationService,
            INavigationService navigationService,
            ICommandFactory commandFactory,
            IPopupService popupService)
            : base(accessControlManager, commandFactory)
        {
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _notificationService           = notificationService;
            _navigationService             = navigationService;
            _popupService      = popupService;
            _userDialogService = userDialogService;
            _eventAggregator   = eventAggregator;

            _eventAggregator.GetEvent <AppointmentCreatedEvent> ().Subscribe(
                AppointmentCreatedEventHandler,
                ThreadOption.BackgroundThread,
                false,
                FilterAppointmentCreatedEvents);

            _eventAggregator.GetEvent <VisitChangedEvent> ().Subscribe(
                VisitChangedEventHandler,
                ThreadOption.BackgroundThread,
                false,
                FilterVisitChangedEvents);

            _eventAggregator.GetEvent <AppointmentUpdatedEvent> ().Subscribe(
                AppointmentUpdatedEventHandler,
                ThreadOption.BackgroundThread,
                false,
                FilterAppointmentUpdatedEvents);

            _eventAggregator.GetEvent <PatientChangedEvent> ().Subscribe(
                FilterPatientChangedEventHandler,
                ThreadOption.BackgroundThread,
                false,
                FilterPatientChangedEvents);

            var commandFactoryHelper = CommandFactoryHelper.CreateHelper(this, commandFactory);

            StatusUpdatedCommand = commandFactoryHelper.BuildDelegateCommand <ClinicianAppointmentDto> (
                () => StatusUpdatedCommand, ExecuteStatusUpdatedCommand);
            AppointmentUpdatedCommand = commandFactoryHelper.BuildDelegateCommand <ClinicianAppointmentDto> (
                () => AppointmentUpdatedCommand,
                ExecuteAppointmentUpdatedCommand,
                CanExecuteAppointmentUpdatedCommand);
            ShowAppointmentDetailsCommand =
                commandFactoryHelper.BuildDelegateCommand <ClinicianAppointmentDto> (
                    () => ShowAppointmentDetailsCommand, ExecuteDoubleClickAppointmentCommand, CanExecuteDoubleClickAppointmentCommand);
            RangeUpdatedCommand = commandFactoryHelper.BuildDelegateCommand <DateRange> (
                () => RangeUpdatedCommand,
                ExecuteRangeUpdatedCommand,
                CanExecuteRangeUpdatedCommand);
            AppointmentAddedCommand = commandFactoryHelper.BuildDelegateCommand <ClinicianAppointmentDto> (
                () => AppointmentAddedCommand, ExecuteAppointmentAddedCommand, CanExecuteAppointmentAddedCommand);
            AppointmentDeletedCommand = commandFactoryHelper.BuildDelegateCommand <ClinicianAppointmentDto> (
                () => AppointmentDeletedCommand, ExecuteAppointmentDeletedCommand, CanExecuteAppointmentDeletedCommand);
            ShowAlertDetailsCommand = commandFactoryHelper.BuildDelegateCommand <PatientAlertDto> (
                () => ShowAlertDetailsCommand, ExecuteShowAlertDetailsCommand);
            GoToPatientDashboardCommand = commandFactoryHelper.BuildDelegateCommand <ClinicianAppointmentDto> (
                () => GoToPatientDashboardCommand, ExecuteGoToPatientDashboardCommand);
            GoToPatientProfileCommand = commandFactoryHelper.BuildDelegateCommand <ClinicianAppointmentDto> (
                () => GoToPatientProfileCommand, ExecuteGoToPatientProfileCommand);
            GoToPaymentCommand = commandFactoryHelper.BuildDelegateCommand <ClinicianAppointmentDto> (
                () => GoToPaymentCommand, ExecuteGoToPaymentCommand);

            ClinicianSchedule = new ClinicianScheduleDto();

            _eventAggregator.GetEvent <FrontDeskDashboardDateChangedEvent> ().Subscribe(
                OnFrontDeskDashboardDateChanged, ThreadOption.PublisherThread, false, FilterFrontDeskDashboardDateChanged);
        }