Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ProgramOfferingEditorViewModel"/> class.
        /// </summary>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="commandFactory">The command factory.</param>
        /// <param name="popupService">The popup service.</param>
        public ProgramOfferingEditorViewModel(
            IUserDialogService userDialogService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            ICommandFactory commandFactory,
            IPopupService popupService)
            : base(userDialogService, asyncRequestDispatcherFactory, accessControlManager, commandFactory)
        {
            _userDialogService             = userDialogService;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _popupService = popupService;

            CreateCommand = NavigationCommandManager.BuildCommand(() => CreateCommand, NavigateToCreateCommand);
            EditCommand   = NavigationCommandManager.BuildCommand(() => EditCommand, NavigateToEditCommand);

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

            SaveCommand = commandFactoryHelper.BuildDelegateCommand <KeyedDataTransferObject> (
                () => SaveCommand,
                dto =>
            {
                var name = PropertyUtil.ExtractPropertyName(() => EditingDto);
                if (dto != null && EditingDto.GetType() != dto.GetType())
                {
                    name = EditingDto.GetType().GetProperties().First(pi => pi.PropertyType == dto.GetType()).Name;
                }
                return(name);
            },
                ExecuteSaveCommand,
                CanExecuteSaveCommand);
        }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SaveMailAttachmentPatientDocumentViewModel"/> class.
        /// </summary>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="commandFactory">The command factory.</param>
        /// <param name="eventAggregator">The event aggregator.</param>
        /// <param name="navigationService">The navigation service.</param>
        /// <param name="popupService">The popup service.</param>
        public SaveMailAttachmentPatientDocumentViewModel(
            IUserDialogService userDialogService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            ICommandFactory commandFactory,
            IEventAggregator eventAggregator,
            INavigationService navigationService,
            IPopupService popupService)
            : base(userDialogService, asyncRequestDispatcherFactory, accessControlManager, commandFactory)
        {
            _userDialogService             = userDialogService;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _eventAggregator   = eventAggregator;
            _navigationService = navigationService;
            _popupService      = popupService;

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

            CreatePatientImportDocumentCommand = commandFactoryHelper.BuildDelegateCommand(
                () => CreatePatientImportDocumentCommand, ExecuteCreatePatientImportDocumentCommand);

            var ruleExecutor = new NotifyPropertyChangedRuleExecutor <SaveMailAttachmentPatientDocumentViewModel, IDataTransferObject> ();

            ruleExecutor.AddRunAllRulesProperty(vm => vm.EditingDto);
            ruleExecutor.WatchSubject(this);
        }
        public ProgramOfferingListViewModel(
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IUserDialogService userDialogService,
            IPopupService popupService,
            ICommandFactory commandFactory)
            : base(accessControlManager, commandFactory)
        {
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _pagedCollectionViewWrapper    = new PagedCollectionViewWrapper <ProgramOfferingDto> ();
            _userDialogService             = userDialogService;
            _popupService = popupService;

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

            _showAllCommand              = commandFactoryHelper.BuildDelegateCommand(() => ShowAllCommand, ExecuteShowAll);
            _showActiveOnlyCommand       = commandFactoryHelper.BuildDelegateCommand(() => ShowActiveOnlyCommand, ExecuteShowActiveOnly);
            ToggleActiveIndicatorCommand = commandFactoryHelper.BuildDelegateCommand <ProgramOfferingDto> (
                () => ToggleActiveIndicatorCommand, ExecuteToggleActiveIndicator);
            ShowProgramOfferingAddCommand = commandFactoryHelper.BuildDelegateCommand <object> (
                () => ShowProgramOfferingAddCommand, ExecuteShowProgramOfferingAddCommand);
            ShowProgramOfferingEditCommand = commandFactoryHelper.BuildDelegateCommand <ProgramOfferingDto> (
                () => ShowProgramOfferingEditCommand, ExecuteShowProgramOfferingEditCommand);
            DeleteProgramOfferingCommand = commandFactoryHelper.BuildDelegateCommand <ProgramOfferingDto> (
                () => DeleteProgramOfferingCommand, ExecuteDeleteProgramOfferingCommand);

            _showOption = ShowOption.ShowActive;
            _filter     = FilterByActiveStatus;
            InitializeGroupingDescriptions();
        }
Example #4
0
 public ChatService(ClientHandler clientHandler, IUserDialogService dialogService)
 {
     ClientHandler = clientHandler;
     DialogService = dialogService;
     ClientHandler.MessageRecieveed  += ClientHandler_MessageRecieveed;
     ClientHandler.ConnectionChanged += ClientHandler_ClientStateChanged;
 }
Example #5
0
        public PhotoViewModel(IUserDialogService dialogs, IPhotoService photos)
        {
            this.dialogs = dialogs;
            this.photos  = photos;

            this.FromCamera = new Command(async() => {
                if (!photos.IsCameraAvailable)
                {
                    dialogs.Alert("Camera is not available");
                }
                else
                {
                    var result = await photos.FromCamera();
                    this.OnPhotoReceived(result);
                }
            });

            this.FromGallery = new Command(async() => {
                if (!photos.IsGalleryAvailable)
                {
                    dialogs.Alert("Photo Gallery is unavailable");
                }
                else
                {
                    var result = await photos.FromGallery();
                    this.OnPhotoReceived(result);
                }
            });

            this.Choice = new Command(() => dialogs.ActionSheet(x => x
                                                                .Add("Camera", () => this.FromCamera.Execute(null))
                                                                .Add("Gallery", () => this.FromGallery.Execute(null))
                                                                .Add("Cancel")
                                                                ));
        }
Example #6
0
 public PayPrepareViewModel(IUserDialogService dialogService)
 {
     //CurrentCart = cart;
     MessagingCenter.Subscribe <Cart>(this, "PaymentStart", async(s) =>
     {
         CurrentCart = s;
         if (RemainAmt == 0)
         {
             dialogService.ShowLoading("保存销售中");
             try
             {
                 var result = await PosSDK.CallAPI <Cart>("/order/place-order", new
                 {
                     cartId = this.CartId
                 });
                 if (result.Success == true)
                 {
                     Messenger.Default.Send <string>(string.Empty, "OrderPayComplete");
                 }
             }
             catch (Exception)
             {
             }
             finally {
                 dialogService.HideLoading();
             }
         }
     });
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="MainPatientSearchViewModel"/> class.
        /// </summary>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="navigationService">The navigation service.</param>
        /// <param name="commandFactory">The command factory.</param>
        public MainPatientSearchViewModel(
            IUserDialogService userDialogService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            INavigationService navigationService,
            ICommandFactory commandFactory)
            : base(
                userDialogService,
                asyncRequestDispatcherFactory,
                accessControlManager,
                navigationService,
                commandFactory
                )
        {
            _userDialogService = userDialogService;
            _navigationService = navigationService;

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

            DragStartingCommand  = commandFactoryHelper.BuildDelegateCommand <object> (() => DragStartingCommand, ExecuteDragStartingCommand);
            ViewDashboardCommand = commandFactoryHelper.BuildDelegateCommand <PatientSearchResultDto> (
                () => ViewDashboardCommand, ExecuteViewDashboard);
            ViewProfileCommand          = commandFactoryHelper.BuildDelegateCommand <PatientSearchResultDto> (() => ViewProfileCommand, ExecuteViewProfile);
            ApplyPaymentCommand         = commandFactoryHelper.BuildDelegateCommand <PatientSearchResultDto> (() => ApplyPaymentCommand, ExecuteApplyPayment);
            CreateNewAppointmentCommand = commandFactoryHelper.BuildDelegateCommand <PatientSearchResultDto> (
                () => CreateNewAppointmentCommand, ExecuteCreateNewAppointment);
        }
Example #8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PatientListViewModel"/> class.
        /// </summary>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="commandFactory">The command factory.</param>
        public PatientListViewModel(
            IUserDialogService userDialogService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            ICommandFactory commandFactory )
            : base(accessControlManager, commandFactory)
        {
            _userDialogService = userDialogService;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;

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

            SearchCommand = commandFactoryHelper.BuildDelegateCommand ( () => SearchCommand, ExecuteSearchCommand );
            ClearCommand = commandFactoryHelper.BuildDelegateCommand ( () => ClearCommand, ExecuteClearCommand );

            PatientListCriteria = new PatientListCriteriaDto ();
            PatientListCriteria.PageSize = DEFAULTPAGESIZE;
            PatientListCriteria.LabResultFilterModifier = FilterModifier.EqualTo;
            PatientListCriteria.AgeFilterModifier = FilterModifier.EqualTo;

            FilterModifierList = new List<string>
                {
                    FilterModifier.EqualTo,
                    FilterModifier.GreaterThan,
                    FilterModifier.GreaterThanOrEqualTo,
                    FilterModifier.LessThen,
                    FilterModifier.LessThenOrEqualTo
                };
        }
Example #9
0
        public TaskAndTakGroupListViewModel(
            IUserDialogService userDialogService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IPopupService popupService,
            ICommandFactory commandFactory)
            : base(accessControlManager, commandFactory)
        {
            _popupService = popupService;

            _userDialogService             = userDialogService;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;

            _pagedCollectionViewWrapper = new PagedCollectionViewWrapper <SystemRoleDto> ();

            InitializeGroupingDescriptions();

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

            CreateTaskOrTaskGroupCommand = commandFactoryHelper.BuildDelegateCommand <object> (
                () => CreateTaskOrTaskGroupCommand, ExecuteCreateTaskOrTaskGroupCommand);
            EditTaskOrTaskGroupCommand = commandFactoryHelper.BuildDelegateCommand <SystemRoleDto> (
                () => EditTaskOrTaskGroupCommand, ExecuteEditTaskOrTaskGroupCommand);
            CloneTaskOrTaskGroupCommand = commandFactoryHelper.BuildDelegateCommand <SystemRoleDto> (
                () => CloneTaskOrTaskGroupCommand, ExecuteCloneTaskOrTaskGroupCommand);
            DeleteTaskOrTaskGroupCommand = commandFactoryHelper.BuildDelegateCommand <SystemRoleDto> (
                () => DeleteTaskOrTaskGroupCommand, ExecuteDeleteTaskOrTaskGroup);
        }
        public PhotoViewModel(IUserDialogService dialogs, IMediaPicker picker)
        {
            this.dialogs = dialogs;

            this.FromCamera = new Command(async() => {
                if (!picker.IsCameraAvailable)
                {
                    dialogs.Alert("Camera is not available");
                }
                else
                {
                    var result = await picker.TakePhoto();
                    this.OnPhotoReceived(result);
                }
            });

            this.FromGallery = new Command(async() => {
                if (!picker.IsPhotoGalleryAvailable)
                {
                    dialogs.Alert("Photo Gallery is unavailable");
                }
                else
                {
                    var result = await picker.PickPhoto();
                    this.OnPhotoReceived(result);
                }
            });

            this.Choice = new Command(() => dialogs.ActionSheet(new ActionSheetConfig()
                                                                .Add("Camera", () => this.FromCamera.Execute(null))
                                                                .Add("Gallery", () => this.FromGallery.Execute(null))
                                                                .Add("Cancel")
                                                                ));
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="LocationWorkspaceViewModel"/> class.
        /// </summary>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="eventAggregator">The event aggregator.</param>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="navigationService">The navigation service.</param>
        /// <param name="commandFactory">The command factory.</param>
        public LocationWorkspaceViewModel(
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IUserDialogService userDialogService,
            IEventAggregator eventAggregator,
            IAccessControlManager accessControlManager,
            INavigationService navigationService,
            ICommandFactory commandFactory )
            : base(accessControlManager, commandFactory)
        {
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _userDialogService = userDialogService;
            _eventAggregator = eventAggregator;
            _navigationService = navigationService;

            _eventAggregator.GetEvent<LocationChangedEvent> ().Subscribe (
                LocationChangedEventHandler,
                ThreadOption.BackgroundThread,
                false,
                FilterLocationChangedEvents );

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

            GoToDashboardCommand = commandFactoryHelper.BuildDelegateCommand ( () => GoToDashboardCommand, ExecuteGoToDashboard );
            GoToProfileCommand = commandFactoryHelper.BuildDelegateCommand<object> ( () => GoToProfileCommand, ExecuteGoToProfile );
        }
Example #12
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PatientReminderViewModel"/> class.
        /// </summary>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="commandFactory">The command factory.</param>
        public PatientReminderViewModel(
            IUserDialogService userDialogService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            ICommandFactory commandFactory)
            : base(accessControlManager, commandFactory)
        {
            _userDialogService             = userDialogService;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;

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

            SearchCommand = commandFactoryHelper.BuildDelegateCommand(() => SearchCommand, ExecuteSearchCommand);
            ClearCommand  = commandFactoryHelper.BuildDelegateCommand(() => ClearCommand, ExecuteClearCommand);

            PageSize = DEFAULTPAGESIZE;
            PatientReminderCriteria = new PatientReminderCriteriaDto
            {
                PageSize = DEFAULTPAGESIZE,
                LabResultFilterModifier = FilterModifier.EqualTo,
                AgeFilterModifier       = FilterModifier.EqualTo
            };

            FilterModifierList = new List <string>
            {
                FilterModifier.EqualTo,
                FilterModifier.GreaterThan,
                FilterModifier.GreaterThanOrEqualTo,
                FilterModifier.LessThen,
                FilterModifier.LessThenOrEqualTo
            };
        }
 public ShowAllTicketsViewModel(ITicketService ticketService, IUserDialogService dialogService)
 {
     _ticketService = ticketService;
     _dialogService = dialogService;
     Tickets        = new ObservableCollection <TicketModel>();
     UpdateTickets();
 }
Example #14
0
        public ClaimBatchListViewModel(
            IUserDialogService userDialogService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IPopupService popupService,
            ICommandFactory commandFactory)
            : base(accessControlManager, commandFactory)
        {
            _popupService      = popupService;
            _userDialogService = userDialogService;

            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;

            _pagedCollectionViewWrapper = new PagedCollectionViewWrapper <ClaimBatchDisplayNameDto> ();

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

            DownloadHealthCareClaim837ProfessionalCommand = commandFactoryHelper.BuildDelegateCommand <object> (
                () => DownloadHealthCareClaim837ProfessionalCommand,
                ExecuteDownloadHealthCareClaim837ProfessionalCommand,
                CanExecuteDownloadHealthCareClaim837ProfessionalCommand);

            RefreshCommand       = commandFactoryHelper.BuildDelegateCommand <object> (() => RefreshCommand, ExecuteRefreshCommand);
            ResetTestDataCommand = commandFactoryHelper.BuildDelegateCommand <object> (() => ResetTestDataCommand, ExecuteResetTestDataCommand);
        }
Example #15
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PayorCoverageViewModel"/> class.
        /// </summary>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="commandFactory">The command factory.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="popupService">The popup service.</param>
        /// <param name="navigationService">The navigation service.</param>
        public PayorCoverageViewModel(
            IAccessControlManager accessControlManager,
            ICommandFactory commandFactory,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IUserDialogService userDialogService,
            IPopupService popupService,
            INavigationService navigationService)
            : base(accessControlManager, commandFactory)
        {
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _userDialogService             = userDialogService;
            _popupService      = popupService;
            _navigationService = navigationService;

            PageSize = 50;

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

            DeletePayorCoverageCommand = commandFactoryHelper.BuildDelegateCommand <PayorCoverageCacheDto> (
                () => DeletePayorCoverageCommand, ExecuteDeletePayorCoverageCommand);
            ShowPayorCoverageEditorCommand = commandFactoryHelper.BuildDelegateCommand <PayorCoverageCacheDto> (
                () => ShowPayorCoverageEditorCommand, ExecuteShowPayorCoverageEditorCommand);
            GoToPatientHistoryCommand = commandFactoryHelper.BuildDelegateCommand(
                () => GoToPatientHistoryCommand, ExecuteGoToPatientHistoryCommand);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="MainPatientSearchViewModel"/> class.
        /// </summary>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="navigationService">The navigation service.</param>
        /// <param name="commandFactory">The command factory.</param>
        public MainPatientSearchViewModel(
            IUserDialogService userDialogService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            INavigationService navigationService,
            ICommandFactory commandFactory )
            : base(userDialogService,
                asyncRequestDispatcherFactory,
                accessControlManager,
                navigationService,
                commandFactory)
        {
            _userDialogService = userDialogService;
            _navigationService = navigationService;

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

            DragStartingCommand = commandFactoryHelper.BuildDelegateCommand<object> ( () => DragStartingCommand, ExecuteDragStartingCommand );
            ViewDashboardCommand = commandFactoryHelper.BuildDelegateCommand<PatientSearchResultDto> (
                () => ViewDashboardCommand, ExecuteViewDashboard );
            ViewProfileCommand = commandFactoryHelper.BuildDelegateCommand<PatientSearchResultDto> ( () => ViewProfileCommand, ExecuteViewProfile );
            ApplyPaymentCommand = commandFactoryHelper.BuildDelegateCommand<PatientSearchResultDto> ( () => ApplyPaymentCommand, ExecuteApplyPayment );
            CreateNewAppointmentCommand = commandFactoryHelper.BuildDelegateCommand<PatientSearchResultDto> (
                () => CreateNewAppointmentCommand, ExecuteCreateNewAppointment );
        }
        public NetworkViewModel(INetworkService networkService, IUserDialogService dialogService)
        {
            this.Host = "google.ca";

            this.Network = networkService;
            this.Check   = new Command(async() => {
                if (String.IsNullOrWhiteSpace(this.Host))
                {
                    dialogService.Alert("You must enter a host");
                }

                else
                {
                    var reached = false;
                    using (dialogService.Loading())
                        reached = await networkService.IsHostReachable(this.Host);

                    var msg = (reached
                        ? " is reachable"
                        : " cannot be reached"
                               );
                    dialogService.Alert(this.Host + msg);
                }
            });
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="TedsAdmissionInterviewViewModel"/> class.
        /// </summary>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="eventAggregator">The event aggregator.</param>
        /// <param name="commandFactory">The command factory.</param>
        public TedsAdmissionInterviewViewModel(
            IUserDialogService userDialogService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IEventAggregator eventAggregator,
            ICommandFactory commandFactory)
            : base(userDialogService, asyncRequestDispatcherFactory, accessControlManager, eventAggregator, commandFactory)
        {
            _userDialogService             = userDialogService;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;

            _primaryDetailedDrugCodeList   = new ObservableCollection <DetailedDrugCodeDto> ();
            _secondaryDetailedDrugCodeList = new ObservableCollection <DetailedDrugCodeDto> ();
            _tertiaryDetailedDrugCodeList  = new ObservableCollection <DetailedDrugCodeDto> ();

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

            RemoveSubstanceUsageCommand = commandFactoryHelper.BuildDelegateCommand <string> (
                () => RemoveSubstanceUsageCommand, ExecuteRemoveSubstanceUsage);

            var ruleExecutor = new NotifyPropertyChangedRuleExecutor <TedsAdmissionInterviewViewModel, IDataTransferObject>();

            ruleExecutor.AddRunAllRulesProperty(vm => vm.EditingDto);
            ruleExecutor.WatchSubject(this);
        }
        public JobFunctionListViewModel(
            IUserDialogService userDialogService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IPopupService popupService,
            ICommandFactory commandFactory )
            : base(accessControlManager, commandFactory)
        {
            _popupService = popupService;
            _userDialogService = userDialogService;

            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;

            _pagedCollectionViewWrapper = new PagedCollectionViewWrapper<SystemRoleDto> ();

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

            CreateJobFunctionCommand = commandFactoryHelper.BuildDelegateCommand ( () => CreateJobFunctionCommand, ExecuteCreateJobFunctionCommand );
            EditJobFunctionCommand = commandFactoryHelper.BuildDelegateCommand<SystemRoleDto> (
                () => EditJobFunctionCommand, ExecuteEditJobFunctionCommand );
            CloneJobFunctionCommand = commandFactoryHelper.BuildDelegateCommand<SystemRoleDto> (
                () => CloneJobFunctionCommand, ExecuteCloneJobFunctionCommand );
            DeleteJobFunctionCommand = commandFactoryHelper.BuildDelegateCommand<SystemRoleDto> (
                () => DeleteJobFunctionCommand, ExecuteDeleteJobFunction );
        }
Example #20
0
 public ShowAllAirportsViewModel(IAirportService airportService, IUserDialogService dialogService)
 {
     _airportService = airportService;
     _dialogService  = dialogService;
     Airports        = new ObservableCollection <AirportModel>();
     UpdateAirports();
 }
 public MainPageViewModel(INavigationService navigationService, IUserDialogService dialogService)
 {
     _navigationService             = navigationService;
     _dialogService                 = dialogService;
     NavigateCommand                = new DelegateCommand <string>(OnNavigateCommandExecuted);
     LaunchDynamicTabbedPageCommand = new DelegateCommand(OnLaunchDynamicTabbedPageCommandExecuted);
 }
Example #22
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SendC32ViewModel"/> class.
        /// </summary>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="commandFactory">The command factory.</param>
        /// <param name="eventAggregator">The event aggregator.</param>
        /// <param name="popupService">The popup service.</param>
        /// <param name="currentUserContextService">The current user context service.</param>
        public SendC32ViewModel(
            IUserDialogService userDialogService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            ICommandFactory commandFactory,
            IEventAggregator eventAggregator,
            IPopupService popupService,
            ICurrentUserContextService currentUserContextService)
            : base(accessControlManager, commandFactory)
        {
            _userDialogService             = userDialogService;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _eventAggregator = eventAggregator;
            _popupService    = popupService;

            currentUserContextService.RegisterForContext((cuc, b) => _currentContext = cuc);

            // UI Commands
            SendC32Command = CommandFactoryHelper
                             .CreateHelper(this, commandFactory)
                             .BuildDelegateCommand(() => SendC32Command, ExecuteSendC32);

            OpenAddressBookCommand = CommandFactoryHelper
                                     .CreateHelper(this, commandFactory)
                                     .BuildDelegateCommand(() => OpenAddressBookCommand, ExecuteOpenAddressBook);

            // Navigation Commands

            OpenSendC32ViewCommand = NavigationCommandManager.BuildCommand(() => OpenSendC32ViewCommand, NavigateToOpenSendC32ViewCommand);

            _eventAggregator.GetEvent <DirectAddressRecipientSelectedEvent> ().Subscribe(HandleDirectAddressRecipientSelectedEventHandler);
        }
        public EditJobFunctionViewModel(
            IUserDialogService userDialogService,
            IEventAggregator eventAggregator,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IPopupService popupService,
            ICommandFactory commandFactory )
            : base(accessControlManager, commandFactory)
        {
            _userDialogService = userDialogService;
            _eventAggregator = eventAggregator;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _popupService = popupService;

            Wrapper = new EditableDtoWrapper ();

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

            SaveJobFunctionCommand = commandFactoryHelper.BuildDelegateCommand ( () => SaveJobFunctionCommand, ExecuteSaveJobFunctionCommand );
            GrantSystemRoleCommand = commandFactoryHelper.BuildDelegateCommand ( () => GrantSystemRoleCommand, ExecuteGrantSystemRoleCommand );
            RevokeSystemRoleCommand = commandFactoryHelper.BuildDelegateCommand<SystemRoleDto> (
                () => RevokeSystemRoleCommand, ExecuteRevokeSystemRoleCommand );
            CancelCommand = commandFactoryHelper.BuildDelegateCommand ( () => CancelCommand, ExecuteCancelCommand );

            CreateCommand = NavigationCommandManager.BuildCommand ( () => CreateCommand, NavigateToCreateCommand );
            EditCommand = NavigationCommandManager.BuildCommand ( () => EditCommand, NavigateToEditCommand );
            CloneCommand = NavigationCommandManager.BuildCommand ( () => CloneCommand, NavigateToCloneCommand );
        }
        public PhotoViewModel(IUserDialogService dialogs, IPhotoService photos) {
        //public PhotoViewModel() {
            //this.dialogs = DependencyService.Get<IUserDialogService>();
            //this.photos = DependencyService.Get<IPhotoService>();
            this.dialogs = dialogs;
            this.photos = photos;

            this.FromCamera = new Command(async () => {
                if (!photos.IsCameraAvailable)
                    dialogs.Alert("Camera is not available");
                else { 
                    var result = await photos.FromCamera();
                    this.OnPhotoReceived(result);
                }
            });

            this.FromGallery = new Command(async () => {
                if (!photos.IsGalleryAvailable)
                    dialogs.Alert("Photo Gallery is unavailable");
                else { 
                    var result = await photos.FromGallery();
                    this.OnPhotoReceived(result);
                }
            });

            this.Choice = new Command(() => dialogs.ActionSheet(x => x
                .Add("Camera", () => this.FromCamera.Execute(null))
                .Add("Gallery", () => this.FromGallery.Execute(null))
                .Add("Cancel")
            ));
        }
        public TaskAndTakGroupListViewModel(
            IUserDialogService userDialogService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IPopupService popupService,
            ICommandFactory commandFactory )
            : base(accessControlManager, commandFactory)
        {
            _popupService = popupService;

            _userDialogService = userDialogService;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;

            _pagedCollectionViewWrapper = new PagedCollectionViewWrapper<SystemRoleDto> ();

            InitializeGroupingDescriptions ();

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

            CreateTaskOrTaskGroupCommand = commandFactoryHelper.BuildDelegateCommand<object> (
                () => CreateTaskOrTaskGroupCommand, ExecuteCreateTaskOrTaskGroupCommand );
            EditTaskOrTaskGroupCommand = commandFactoryHelper.BuildDelegateCommand<SystemRoleDto> (
                () => EditTaskOrTaskGroupCommand, ExecuteEditTaskOrTaskGroupCommand );
            CloneTaskOrTaskGroupCommand = commandFactoryHelper.BuildDelegateCommand<SystemRoleDto> (
                () => CloneTaskOrTaskGroupCommand, ExecuteCloneTaskOrTaskGroupCommand );
            DeleteTaskOrTaskGroupCommand = commandFactoryHelper.BuildDelegateCommand<SystemRoleDto> (
                () => DeleteTaskOrTaskGroupCommand, ExecuteDeleteTaskOrTaskGroup );
        }
        public PaginatedPropertyListModel(IPropertyTrackerService service, IUserDialogService dialogService)
        {
            _propertyTrackerService = service;
            _dialogService          = dialogService;

            Reset();
        }
Example #27
0
 public HomeViewModel(IDeviceInfoService deviceInfo, IUserDialogService dialogs)
 {
     this.Menu = new List<MenuItemViewModel> {
         new MenuItemViewModel(
             "Barcode Scanning",
             () => {
                 if (deviceInfo.IsRearCameraAvailable) {
                     this.ShowViewModel<BarCodeViewModel>();
                 }
                 else {
                     dialogs.Alert("Rear camera is unavailable");
                 }
             }
         ),
         new MenuItemViewModel(
             "Device Info",
             () => this.ShowViewModel<DeviceInfoViewModel>()
         ),
         new MenuItemViewModel(
             "Dialogs",
             () => this.ShowViewModel<DialogsViewModel>()
         ),
         new MenuItemViewModel(
             "Network",
             () => this.ShowViewModel<NetworkViewModel>()
         ),
         new MenuItemViewModel(
             "Settings",
             () => this.ShowViewModel<SettingsViewModel>()
         )
     };
 }
Example #28
0
 public SmsViewModel(IPhoneService phone, IUserDialogService dialogs)
 {
     this.Send = new Command(() => {
         phone.Sms(this.PhoneNumber, this.Message);
         dialogs.Alert("Message sent");
     });
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="NidaDrugQuestionnaireViewModel"/> class.
        /// </summary>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="eventAggregator">The event aggregator.</param>
        /// <param name="commandFactory">The command factory.</param>
        public NidaDrugQuestionnaireViewModel(
            IUserDialogService userDialogService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IEventAggregator eventAggregator,
            ICommandFactory commandFactory)
            : base(userDialogService, asyncRequestDispatcherFactory, accessControlManager, eventAggregator, commandFactory)
        {
            _eventAggregator = eventAggregator;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _userDialogService             = userDialogService;

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

            SaveCommand = commandFactoryHelper.BuildDelegateCommand <KeyedDataTransferObject> (
                () => SaveCommand,
                dto =>
            {
                var name = PropertyUtil.ExtractPropertyName(() => EditingDto);
                if (dto != null && EditingDto.GetType() != dto.GetType())
                {
                    name = EditingDto.GetType().GetProperties().First(pi => pi.PropertyType == dto.GetType()).Name;
                }
                return(name);
            },
                ExecuteSaveCommand,
                CanExecuteSaveCommand);

            var ruleExecutor = new NotifyPropertyChangedRuleExecutor <NidaDrugQuestionnaireViewModel, IDataTransferObject> ();

            ruleExecutor.AddRunAllRulesProperty(vm => vm.EditingDto);
            ruleExecutor.WatchSubject(this);
        }
        public AppointmentSchedulerViewModel(
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IUserDialogService userDialogService,
            IAccessControlManager accessControlManager,
            IEventAggregator eventAggregator,
            INavigationService navigationService,
            ICommandFactory commandFactory )
            : base(accessControlManager, commandFactory)
        {
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _userDialogService = userDialogService;
            _eventAggregator = eventAggregator;
            _navigationService = navigationService;

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

            _nextDayCommand = commandFactoryHelper.BuildDelegateCommand ( () => NextDayCommand, ExecuteNextDayCommand, CanExecuteNextDayCommand );
            _previousDayCommand = commandFactoryHelper.BuildDelegateCommand (
                () => PreviousDayCommand, ExecutePreviousDayCommand, CanExecutePreviousDayCommand );
            _goToTodayCommand = commandFactoryHelper.BuildDelegateCommand (
                () => GoToTodayCommand, ExecuteGoToTodayCommand, CanExecuteGoToTodayCommand );

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

            _selectedDate = DateTime.Now.Date;

            ApplyContextChanges = true;
        }
Example #31
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AgencyWorkspaceViewModel"/> class.
        /// </summary>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="eventAggregator">The event aggregator.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="navigationService">The navigation service.</param>
        /// <param name="commandFactory">The command factory.</param>
        public AgencyWorkspaceViewModel(
            IUserDialogService userDialogService,
            IEventAggregator eventAggregator,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            INavigationService navigationService,
            ICommandFactory commandFactory)
            : base(accessControlManager, commandFactory)
        {
            _userDialogService             = userDialogService;
            _eventAggregator               = eventAggregator;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _navigationService             = navigationService;

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

            UploadLabResultCommand = commandFactoryHelper.BuildDelegateCommand <object> (() => UploadLabResultCommand, ExecuteUploadLabResultCommand);
            GoToDashboardCommand   = commandFactoryHelper.BuildDelegateCommand(() => GoToDashboardCommand, ExecuteGoToDashboard);
            GoToProfileCommand     = commandFactoryHelper.BuildDelegateCommand <object> (() => GoToProfileCommand, ExecuteGoToProfile);

            _eventAggregator.GetEvent <AgencyChangedEvent> ().Subscribe(
                AgencyChangedEventHandler,
                ThreadOption.BackgroundThread,
                false,
                FilterAgencyChangedEvents);
        }
Example #32
0
        public EditJobFunctionViewModel(
            IUserDialogService userDialogService,
            IEventAggregator eventAggregator,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IPopupService popupService,
            ICommandFactory commandFactory)
            : base(accessControlManager, commandFactory)
        {
            _userDialogService             = userDialogService;
            _eventAggregator               = eventAggregator;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _popupService = popupService;

            Wrapper = new EditableDtoWrapper();

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

            SaveJobFunctionCommand  = commandFactoryHelper.BuildDelegateCommand(() => SaveJobFunctionCommand, ExecuteSaveJobFunctionCommand);
            GrantSystemRoleCommand  = commandFactoryHelper.BuildDelegateCommand(() => GrantSystemRoleCommand, ExecuteGrantSystemRoleCommand);
            RevokeSystemRoleCommand = commandFactoryHelper.BuildDelegateCommand <SystemRoleDto> (
                () => RevokeSystemRoleCommand, ExecuteRevokeSystemRoleCommand);
            CancelCommand = commandFactoryHelper.BuildDelegateCommand(() => CancelCommand, ExecuteCancelCommand);

            CreateCommand = NavigationCommandManager.BuildCommand(() => CreateCommand, NavigateToCreateCommand);
            EditCommand   = NavigationCommandManager.BuildCommand(() => EditCommand, NavigateToEditCommand);
            CloneCommand  = NavigationCommandManager.BuildCommand(() => CloneCommand, NavigateToCloneCommand);
        }
Example #33
0
 public GettingStartedViewModel()
 {
     _blackcoinAddress = string.Empty;
     _commonService    = Mvx.Resolve <ICommonService>();
     _dialogService    = Mvx.Resolve <IUserDialogService>();
     _settingsService  = Mvx.Resolve <ISavedSettingsService>();
 }
Example #34
0
        public JobFunctionListViewModel(
            IUserDialogService userDialogService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IPopupService popupService,
            ICommandFactory commandFactory)
            : base(accessControlManager, commandFactory)
        {
            _popupService      = popupService;
            _userDialogService = userDialogService;

            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;

            _pagedCollectionViewWrapper = new PagedCollectionViewWrapper <SystemRoleDto> ();

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

            CreateJobFunctionCommand = commandFactoryHelper.BuildDelegateCommand(() => CreateJobFunctionCommand, ExecuteCreateJobFunctionCommand);
            EditJobFunctionCommand   = commandFactoryHelper.BuildDelegateCommand <SystemRoleDto> (
                () => EditJobFunctionCommand, ExecuteEditJobFunctionCommand);
            CloneJobFunctionCommand = commandFactoryHelper.BuildDelegateCommand <SystemRoleDto> (
                () => CloneJobFunctionCommand, ExecuteCloneJobFunctionCommand);
            DeleteJobFunctionCommand = commandFactoryHelper.BuildDelegateCommand <SystemRoleDto> (
                () => DeleteJobFunctionCommand, ExecuteDeleteJobFunction);
        }
Example #35
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ActivityViewModelBase&lt;TDto&gt;"/> class.
        /// </summary>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="eventAggregator">The event aggregator.</param>
        /// <param name="commandFactory">The command factory.</param>
        protected ActivityViewModelBase(
            IUserDialogService userDialogService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IEventAggregator eventAggregator,
            ICommandFactory commandFactory)
            : base(userDialogService, asyncRequestDispatcherFactory, accessControlManager, commandFactory)
        {
            _eventAggregator = eventAggregator;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _userDialogService             = userDialogService;

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

            PropertyChanged += (s, e) =>
            {
                if (e.PropertyName == PropertyUtil.ExtractPropertyName(() => EditingDto))
                {
                    UpdateDtoReadOnly();
                }
            };

            EditActivityCommand = NavigationCommandManager.BuildCommand(
                () => EditActivityCommand, NavigateToEditActivityCommand, CanNavigateToEditActivityCommand);
        }
Example #36
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SendC32ViewModel"/> class.
        /// </summary>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="commandFactory">The command factory.</param>
        /// <param name="eventAggregator">The event aggregator.</param>
        /// <param name="popupService">The popup service.</param>
        /// <param name="currentUserContextService">The current user context service.</param>
        public SendC32ViewModel(
            IUserDialogService userDialogService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            ICommandFactory commandFactory,
            IEventAggregator eventAggregator,
            IPopupService popupService,
            ICurrentUserContextService currentUserContextService )
            : base(accessControlManager, commandFactory)
        {
            _userDialogService = userDialogService;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _eventAggregator = eventAggregator;
            _popupService = popupService;

            currentUserContextService.RegisterForContext ( ( cuc, b ) => _currentContext = cuc );

            // UI Commands
            SendC32Command = CommandFactoryHelper
                .CreateHelper ( this, commandFactory )
                .BuildDelegateCommand ( () => SendC32Command, ExecuteSendC32 );

            OpenAddressBookCommand = CommandFactoryHelper
                .CreateHelper ( this, commandFactory )
                .BuildDelegateCommand ( () => OpenAddressBookCommand, ExecuteOpenAddressBook );

            // Navigation Commands

            OpenSendC32ViewCommand = NavigationCommandManager.BuildCommand ( () => OpenSendC32ViewCommand, NavigateToOpenSendC32ViewCommand );

            _eventAggregator.GetEvent<DirectAddressRecipientSelectedEvent> ().Subscribe ( HandleDirectAddressRecipientSelectedEventHandler );
        }
		public PaginatedPropertyListModel(IPropertyTrackerService service,  IUserDialogService dialogService)
        {
            _propertyTrackerService = service;
            _dialogService = dialogService;

			Reset ();
        }
Example #38
0
 public ManualPageViewModel(INavigationService navigationService,
                            IDeviceService deviceService,
                            IUserDialogService userDialogService,
                            IPlaySoundService playSoundService)
     : base(navigationService, deviceService, userDialogService, playSoundService)
 {
 }
        public ProgramOfferingListViewModel(
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IUserDialogService userDialogService,
            IPopupService popupService,
            ICommandFactory commandFactory )
            : base(accessControlManager, commandFactory)
        {
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _pagedCollectionViewWrapper = new PagedCollectionViewWrapper<ProgramOfferingDto> ();
            _userDialogService = userDialogService;
            _popupService = popupService;

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

            _showAllCommand = commandFactoryHelper.BuildDelegateCommand ( () => ShowAllCommand, ExecuteShowAll );
            _showActiveOnlyCommand = commandFactoryHelper.BuildDelegateCommand ( () => ShowActiveOnlyCommand, ExecuteShowActiveOnly );
            ToggleActiveIndicatorCommand = commandFactoryHelper.BuildDelegateCommand<ProgramOfferingDto> (
                () => ToggleActiveIndicatorCommand, ExecuteToggleActiveIndicator );
            ShowProgramOfferingAddCommand = commandFactoryHelper.BuildDelegateCommand<object> (
                () => ShowProgramOfferingAddCommand, ExecuteShowProgramOfferingAddCommand );
            ShowProgramOfferingEditCommand = commandFactoryHelper.BuildDelegateCommand<ProgramOfferingDto> (
                () => ShowProgramOfferingEditCommand, ExecuteShowProgramOfferingEditCommand );
            DeleteProgramOfferingCommand = commandFactoryHelper.BuildDelegateCommand<ProgramOfferingDto> (
                () => DeleteProgramOfferingCommand, ExecuteDeleteProgramOfferingCommand );

            _showOption = ShowOption.ShowActive;
            _filter = FilterByActiveStatus;
            InitializeGroupingDescriptions ();
        }
Example #40
0
        public CreateProgramEnrollmentViewModel(
            IUserDialogService userDialogService,
            IEventAggregator eventAggregator,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IPopupService popupService,
            ICommandFactory commandFactory)
            : base(accessControlManager, commandFactory)
        {
            _userDialogService             = userDialogService;
            _eventAggregator               = eventAggregator;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _popupService = popupService;

            Wrapper = new EditableDtoWrapper();
            _pagedCollectionViewWrapper = new PagedCollectionViewWrapper <ProgramEnrollmentDto> ();

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

            CreateProgramEnrollmentCommand = commandFactoryHelper.BuildDelegateCommand <ProgramEnrollmentDto> (
                () => CreateProgramEnrollmentCommand, ExecuteCreateProgramEnrollment);

            ProgramSelectionChangedCommand = commandFactoryHelper.BuildDelegateCommand <ProgramDisplayNameDto> (
                () => ProgramSelectionChangedCommand, ExecuteProgramSelectionChanged);

            ProgramOfferingLocationSelectionChangedCommand =
                commandFactoryHelper.BuildDelegateCommand <ProgramOfferingLocationDto> (
                    () => ProgramOfferingLocationSelectionChangedCommand, ExecuteProgramOfferingLocationSelectionChanged);
        }
Example #41
0
        public AppointmentSchedulerViewModel(
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IUserDialogService userDialogService,
            IAccessControlManager accessControlManager,
            IEventAggregator eventAggregator,
            INavigationService navigationService,
            ICommandFactory commandFactory)
            : base(accessControlManager, commandFactory)
        {
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _userDialogService             = userDialogService;
            _eventAggregator   = eventAggregator;
            _navigationService = navigationService;

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

            _nextDayCommand     = commandFactoryHelper.BuildDelegateCommand(() => NextDayCommand, ExecuteNextDayCommand, CanExecuteNextDayCommand);
            _previousDayCommand = commandFactoryHelper.BuildDelegateCommand(
                () => PreviousDayCommand, ExecutePreviousDayCommand, CanExecutePreviousDayCommand);
            _goToTodayCommand = commandFactoryHelper.BuildDelegateCommand(
                () => GoToTodayCommand, ExecuteGoToTodayCommand, CanExecuteGoToTodayCommand);

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

            _selectedDate = DateTime.Now.Date;

            ApplyContextChanges = true;
        }
        public PhotoViewModel(IUserDialogService dialogs, IMediaPicker picker) {
            this.dialogs = dialogs;
            this.picker = picker;

            this.FromCamera = new Command(async () => {
                if (!picker.IsCameraAvailable)
                    dialogs.Alert("Camera is not available");
                else { 
                    var result = await picker.TakePhoto();
                    this.OnPhotoReceived(result);
                }
            });

            this.FromGallery = new Command(async () => {
                if (!picker.IsPhotoGalleryAvailable)
                    dialogs.Alert("Photo Gallery is unavailable");
                else { 
                    var result = await picker.PickPhoto();
                    this.OnPhotoReceived(result);
                }
            });

            this.Choice = new Command(() => dialogs.ActionSheet(new ActionSheetConfig()
                .Add("Camera", () => this.FromCamera.Execute(null))
                .Add("Gallery", () => this.FromGallery.Execute(null))
                .Add("Cancel")
            ));
        }
Example #43
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SocialHistoryViewModel"/> class.
        /// </summary>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        /// <param name="accessControlManager">The access control manager.</param>
        /// <param name="eventAggregator">The event aggregator.</param>
        /// <param name="popupService">The popup service.</param>
        /// <param name="navigationService">The navigation service.</param>
        /// <param name="commandFactory">The command factory.</param>
        public SocialHistoryViewModel(
            IUserDialogService userDialogService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IAccessControlManager accessControlManager,
            IEventAggregator eventAggregator,
            IPopupService popupService,
            INavigationService navigationService,
            ICommandFactory commandFactory)
            : base(userDialogService, asyncRequestDispatcherFactory, accessControlManager, eventAggregator, commandFactory)
        {
            var commandFactoryHelper = CommandFactoryHelper.CreateHelper(this, commandFactory);

            SmokingWillingToQuitCommand = commandFactoryHelper.BuildDelegateCommand <object> (
                () => SmokingWillingToQuitCommand, ExecuteSmokingWillingToQuitCommand, CanExecuteSmokingWillingToQuitCommand);
            ScheduleFollowupCommand = commandFactoryHelper.BuildDelegateCommand <object> (
                () => ScheduleFollowupCommand, ExecuteScheduleFollowupCommand, CanExecuteScheduleFollowupCommand);

            _userDialogService             = userDialogService;
            _popupService                  = popupService;
            _navigationService             = navigationService;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _eventAggregator               = eventAggregator;

            var requestDispatcher = _asyncRequestDispatcherFactory.CreateAsyncRequestDispatcher();

            requestDispatcher.AddLookupValuesRequest("SmokingStatus");
            requestDispatcher.ProcessRequests(GetLookupsCompleted, HandleRequestDispatcherException);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="LabTestNameDtsSearchViewModel"/> class.
 /// </summary>
 /// <param name="proxy">The proxy.</param>
 /// <param name="userDialogService">The user dialog service.</param>
 /// <param name="accessControlManager">The access control manager.</param>
 /// <param name="commandFactory">The command factory.</param>
 public LabTestNameDtsSearchViewModel(
     ITerminologyProxy proxy,
     IUserDialogService userDialogService,
     IAccessControlManager accessControlManager,
     ICommandFactory commandFactory )
     : base(proxy, userDialogService, accessControlManager, commandFactory, NamespaceToUse)
 {
 }
		public SignatureListViewModel(ISignatureService signatureService, IUserDialogService dialogs, IFileSystem fileSystem) {
			this.signatureService = signatureService;
			this.dialogs = dialogs;
			this.fileSystem = fileSystem;

			this.Create = new Command(async () => await this.OnCreate());
			this.List = new ObservableList<Signature>();
		}
Example #46
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CurrentUserService"/> class.
 /// </summary>
 /// <param name="userDialogService">The user dialog service.</param>
 /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
 public CurrentUserService(
     IUserDialogService userDialogService,
     IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory )
 {
     _userDialogService = userDialogService;
     _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
     _userPermissions = new List<Permission> ();
 }
		public BasePropertyViewModel (IPropertyTrackerService service, IUserDialogService dialogService, IMvxMessenger messenger)
		{
			_propertyTrackerService = service;
			_dialogService = dialogService;
			_messenger = messenger;

			RegisterSubscriptions ();
		}
		public BarCodeCreateViewModel(IBarCodeService service, IUserDialogService dialogs) {
			this.service = service;
			this.dialogs = dialogs;
            this.Formats = Enum.GetNames(typeof(BarCodeFormat));
            this.selectedFormat = "QR_CODE";
			this.width = 200;
			this.height = 200;
        }
 public StatePickerViewModel(IPropertyTrackerService propertyTrackerService, IGeoDataService geoService, IUserDialogService dialogService, IMvxMessenger messenger)
 {
     _propertyTrackerService = propertyTrackerService;
     _geoService = geoService;
     _dialogService = dialogService;
     _messenger = messenger;
     States = new ObservableCollection<string>();
 }
 public TextToSpeechViewModel(ITextToSpeechService speech, IUserDialogService dialogs) {
     this.Speak = new Command(() => {
         if (String.IsNullOrEmpty(this.Text)) 
             dialogs.Alert("Please enter the text!");
         else 
             speech.Speak(this.Text);
     });
     this.Cancel = new Command(speech.Stop);
 }
Example #51
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SignOffService"/> class.
 /// </summary>
 /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
 /// <param name="userDialogService">The user dialog service.</param>
 /// <param name="redirectService">The redirect service.</param>
 public SignOffService(
     IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
     IUserDialogService userDialogService,
     IRedirectService redirectService )
 {
     _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
     _userDialogService = userDialogService;
     _redirectService = redirectService;
 }
        public SignaturePadConfigViewModel(IUserDialogService dialogs) {
            this.dialogs = dialogs;

            var cfg = SignaturePadConfiguration.Default;
            this.saveText = cfg.SaveText;
            this.cancelText = cfg.CancelText;
            this.promptText = cfg.PromptText;
            this.captionText = cfg.CaptionText;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="LookupQuickPickerViewModel"/> class.
 /// </summary>
 /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
 /// <param name="userDialogService">The user dialog service.</param>
 /// <param name="commandFactory">The command factory.</param>
 public LookupQuickPickerViewModel(
     IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
     IUserDialogService userDialogService,
     ICommandFactory commandFactory )
     : base(commandFactory)
 {
     _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
     _userDialogService = userDialogService;
 }
Example #54
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DTSSearchViewModel"/> class.
 /// </summary>
 /// <param name="proxy">The proxy.</param>
 /// <param name="userDialogService">The user dialog service.</param>
 /// <param name="accessControlManager">The access control manager.</param>
 /// <param name="commandFactory">The command factory.</param>
 /// <param name="namespaceToUse">The namespace to use.</param>
 protected DTSSearchViewModel(
     ITerminologyProxy proxy,
     IUserDialogService userDialogService,
     IAccessControlManager accessControlManager,
     ICommandFactory commandFactory,
     string namespaceToUse )
     : this(proxy, userDialogService, accessControlManager, commandFactory, namespaceToUse, null, null)
 {
 }
Example #55
0
 /// <summary>
 /// Initializes a new instance of the <see cref="StaffSearchViewModel"/> class.
 /// </summary>
 /// <param name="userDialogService">The user dialog service.</param>
 /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
 /// <param name="accessControlManager">The access control manager.</param>
 /// <param name="commandFactory">The command factory.</param>
 public StaffSearchViewModel(
     IUserDialogService userDialogService,
     IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
     IAccessControlManager accessControlManager,
     ICommandFactory commandFactory )
     : base(accessControlManager, commandFactory, new AdvancedSearchCriteriaBase ())
 {
     _userDialogService = userDialogService;
     _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
 }
 /// <summary>
 /// 
 /// </summary>
 public AppConfigurationRequiredServices(IAppConfigurationServiceSetup serviceSetup, IAppConfigurationEndpointService endpointService, IVersionService versionService, IUserDialogService userDialogService, INetworkService networkService,
                                         IFileCacheService fileCacheService)
 {
     this.FileCacheService = fileCacheService;
     this.ServiceSetup = serviceSetup;
     this.EndpointService = endpointService;
     this.VersionService = versionService;
     this.UserDialogService = userDialogService;
     this.NetworkService = networkService;
 }
        public SignaturePadConfigViewModel(ISignatureService signatureService, IUserDialogService dialogs) {
            this.signatureService = signatureService;
            this.dialogs = dialogs;

            var cfg = this.signatureService.Configuration;
            this.saveText = cfg.SaveText;
            this.cancelText = cfg.CancelText;
            this.promptText = cfg.PromptText;
            this.captionText = cfg.CaptionText;
        }
Example #58
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GrowthRateViewModel"/> class.
 /// </summary>
 /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
 /// <param name="userDialogService">The user dialog service.</param>
 /// <param name="accessControlManager">The access control manager.</param>
 /// <param name="commandFactory">The command factory.</param>
 public GrowthRateViewModel(
     IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
     IUserDialogService userDialogService,
     IAccessControlManager accessControlManager,
     ICommandFactory commandFactory )
     : base(accessControlManager, commandFactory)
 {
     _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
     _userDialogService = userDialogService;
 }
        protected BaseUserViewModel(IPropertyTrackerService service, IUserDialogService dialogService, IMvxPictureChooserTask pictureChooserTask, IMvxMessenger messenger)
        {
            _propertyTrackerService = service;
            _dialogService = dialogService;
            _pictureChooserTask = pictureChooserTask;
            _messenger = messenger;
            _properties = new List<Property>();
			UserId = -1;
            RegisterSubscriptions();
        }
Example #60
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PatientAccessService"/> class.
        /// </summary>
        /// <param name="currentUserContextService">The current user context service.</param>
        /// <param name="userDialogService">The user dialog service.</param>
        /// <param name="asyncRequestDispatcherFactory">The async request dispatcher factory.</param>
        public PatientAccessService(
            ICurrentUserContextService currentUserContextService,
            IUserDialogService userDialogService,
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory )
        {
            _userDialogService = userDialogService;
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;

            currentUserContextService.RegisterForContext ( CurrentUserContextChanged );
        }