public RecordCacheHelper(IPageDialogService dialogService,
                          SystemEnvironmentsService systemEnvironmentsService,
                          SystemStatusService systemStatusService, AppStatus appStatus, RefreshTokenService refreshTokenService,
                          ExceptionRecordsService exceptionRecordsService)
 {
     this.dialogService             = dialogService;
     this.systemEnvironmentsService = systemEnvironmentsService;
     this.systemStatusService       = systemStatusService;
     this.appStatus               = appStatus;
     this.refreshTokenService     = refreshTokenService;
     this.exceptionRecordsService = exceptionRecordsService;
 }
 public SplashPageViewModel(INavigationService navigationService, IPageDialogService dialogService,
                            SystemStatusService systemStatusService, SystemEnvironmentsService systemEnvironmentsService,
                            ProjectService projectService, MyUserService myUserService,
                            RecordCacheHelper recordCacheHelper, AppStatus appStatus,
                            ExceptionRecordsService exceptionRecordsService, AppExceptionsService appExceptionsService,
                            LeaveCategoryService leaveCategoryService, OnCallPhoneService onCallPhoneService)
 {
     this.navigationService         = navigationService;
     this.dialogService             = dialogService;
     this.systemStatusService       = systemStatusService;
     this.systemEnvironmentsService = systemEnvironmentsService;
     this.projectService            = projectService;
     this.myUserService             = myUserService;
     this.recordCacheHelper         = recordCacheHelper;
     this.appStatus = appStatus;
     this.exceptionRecordsService = exceptionRecordsService;
     this.appExceptionsService    = appExceptionsService;
     this.leaveCategoryService    = leaveCategoryService;
     this.onCallPhoneService      = onCallPhoneService;
 }
        public HomePageViewModel(INavigationService navigationService, IPageDialogService dialogService,
                                 OnlyAdministratorService OnlyAdministratorService, OnlyUserService OnlyUserService,
                                 RefreshTokenService refreshTokenService,
                                 SystemStatusService systemStatusService, AppStatus appStatus,
                                 AppExceptionsService appExceptionsService, ExceptionRecordsService exceptionRecordsService)
        {
            this.navigationService       = navigationService;
            this.dialogService           = dialogService;
            onlyAdministratorService     = OnlyAdministratorService;
            onlyUserService              = OnlyUserService;
            this.refreshTokenService     = refreshTokenService;
            this.systemStatusService     = systemStatusService;
            this.appStatus               = appStatus;
            this.appExceptionsService    = appExceptionsService;
            this.exceptionRecordsService = exceptionRecordsService;

            #region OnlyAdministratorCommand
            OnlyAdministratorCommand = new DelegateCommand(async() =>
            {
                using (IProgressDialog fooIProgressDialog = UserDialogs.Instance.Loading($"請稍後,執行中...", null, null, true, MaskType.Black))
                {
                    bool fooRefreshTokenResult = await RefreshTokenHelper
                                                 .CheckAndRefreshToken(dialogService, refreshTokenService,
                                                                       systemStatusService, appStatus);
                    if (fooRefreshTokenResult == false)
                    {
                        return;
                    }
                    var fooResult = await OnlyAdministratorService.GetAsync();
                    if (fooResult.Status == false)
                    {
                        Message = fooResult.Message;
                    }
                    else
                    {
                        Message = fooResult.Payload.ToString();
                    }
                }
            });
            #endregion
            #region OnlyUserCommand
            OnlyUserCommand = new DelegateCommand(async() =>
            {
                using (IProgressDialog fooIProgressDialog = UserDialogs.Instance.Loading($"請稍後,執行中...", null, null, true, MaskType.Black))
                {
                    bool fooRefreshTokenResult = await RefreshTokenHelper
                                                 .CheckAndRefreshToken(dialogService, refreshTokenService,
                                                                       systemStatusService, appStatus);
                    if (fooRefreshTokenResult == false)
                    {
                        return;
                    }
                    var fooResult = await OnlyUserService.GetAsync();
                    if (fooResult.Status == false)
                    {
                        Message = fooResult.Message;
                    }
                    else
                    {
                        Message = fooResult.Payload.ToString();
                    }
                }
            });
            #endregion
            #region 故意拋出例外
            ThrowExceptionrCommand = new DelegateCommand(async() =>
            {
                throw new Exception("魔鬼藏在細節中");
            });
            #endregion
        }