private void InitializeViewModel(IPolicyDataService policyDataService, ICountriesService countriesService)
        {
            PolicyDataService = policyDataService;
            CountriesService  = countriesService;

            SetInsuranceTypesList();
            SetCreditCardTypesList();

            RefreshPolicyListCommand = new RelayCommand(LoadInsurancePolicies, () => IsPathToFileSpecified);
            SavePoliciesCommand      = new RelayCommand(SavePolicies, () => IsPathToFileSpecified);
            ExitApplicationCommand   = new RelayCommand(ExitApplication);
            CloseFileCommand         = new RelayCommand(CloseFile, () => IsPathToFileSpecified);
            OpenFileDialogCommand    = new RelayCommand(OpenFileDialog);

            PropertyChanged += InsurancePolicyViewModel_PropertyChanged;
            PolicyDataService.PoliciesChanged += _dataService_PoliciesChanged;

            try
            {
                // This block throws exception with in unit test. Unable to find required Reference to
                // eliminate the exception. The issue is scheme: "pack://" is not recognized outside of the
                // WPF project.
                UpToDateStatusImage  = LoadBitmapImage(upToDateStatusImagePath);
                OutOfDateStatusImage = LoadBitmapImage(outOfDateStatusImagePath);
            }
            catch (UriFormatException) { }
        }
        private void InitializeViewModel(IPolicyDataService policyDataService, ICountriesService countriesService)
        {
            PolicyDataService = policyDataService;
            CountriesService = countriesService;

            SetInsuranceTypesList();
            SetCreditCardTypesList();

            RefreshPolicyListCommand = new RelayCommand(LoadInsurancePolicies, () => IsPathToFileSpecified);
            SavePoliciesCommand = new RelayCommand(SavePolicies, () => IsPathToFileSpecified);
            ExitApplicationCommand = new RelayCommand(ExitApplication);
            CloseFileCommand = new RelayCommand(CloseFile, () => IsPathToFileSpecified);
            OpenFileDialogCommand = new RelayCommand(OpenFileDialog);

            PropertyChanged += InsurancePolicyViewModel_PropertyChanged;
            PolicyDataService.PoliciesChanged += _dataService_PoliciesChanged;

            try
            {
                // This block throws exception with in unit test. Unable to find required Reference to
                // eliminate the exception. The issue is scheme: "pack://" is not recognized outside of the
                // WPF project.
                UpToDateStatusImage = LoadBitmapImage(upToDateStatusImagePath);
                OutOfDateStatusImage = LoadBitmapImage(outOfDateStatusImagePath);
            }
            catch (UriFormatException) { }
        }
Example #3
0
 public PolicySearchViewModel(IPolicyDataService policyDataService, IEventAggregator eventAggregator)
 {
     this.policyDataService           = policyDataService;
     this.eventAggregator             = eventAggregator;
     this.PolicySearch                = new PolicySearch();
     this.searchCommand               = new DelegateCommand <object>(this.Search, this.CanSearch);
     this.policySearch.ErrorsChanged += this.policySearch_ErrorsChanged;
 }
 public InsurancePolicyViewModel(IPolicyDataService policyDataService, ICountriesService countriesService)
 {
     InitializeViewModel(policyDataService, countriesService);
 }
Example #5
0
 public ValuesController(IPolicyDataService policyService)
 {
     _policyService = policyService;
 }
 public AuthorizationHandler(IPolicyDataService policyDataService, IHttpClientFactory httpClientFactory)
 {
     _policyDataService = policyDataService;
     _opaClient         = httpClientFactory.CreateClient();
 }
 public InsurancePolicyViewModel(IPolicyDataService policyDataService, ICountriesService countriesService)
 {
     InitializeViewModel(policyDataService,countriesService);
 }