示例#1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            ViewModel.View = this;
            var set = this.CreateBindingSet <ViewProfileView, ViewProfileViewModel>();

            set.Bind(lbFirstName).To(vm => vm.UserProfile.PersonalProfile.FirstName);
            set.Bind(lbLastName).To(vm => vm.UserProfile.PersonalProfile.LastName);
            set.Bind(lbEmailAddress).To(vm => vm.UserProfile.PersonalProfile.Email);
            set.Bind(lbDOB).To(vm => vm.DOBText);

            set.Bind(lbMobileNumber).To(vm => vm.UserProfile.PersonalProfile.Mobile);
            set.Bind(lbUnit).To(vm => vm.UserProfile.PersonalProfile.BulidingNo);
            set.Bind(lbStreetName).To(vm => vm.UserProfile.PersonalProfile.Street);
            set.Bind(lbPostcode).To(vm => vm.UserProfile.PersonalProfile.PostCode);
            set.Bind(lbState).To(vm => vm.UserProfile.PersonalProfile.State);
            set.Bind(lbFullName).To(vm => vm.UserProfile.PersonalProfile.NOK);
            set.Bind(lbContactNumber).To(vm => vm.UserProfile.PersonalProfile.NOKPhone);

            set.Bind(lbCardNumber).To(vm => vm.UserProfile.PersonalProfile.Certs[0].Identifier);
            set.Bind(lbCardExpiry).To(vm => vm.UserProfile.PersonalProfile.Certs[0].ExpiryText);

            set.Bind(lbTypeOfTrade).To(vm => vm.UserProfile.PersonalProfile.Certs[1].Descriptor);
            set.Bind(lbTradeLicenceNumber).To(vm => vm.UserProfile.PersonalProfile.Certs[1].Identifier);
            set.Bind(lbTradeLicenceExpiry).To(vm => vm.UserProfile.PersonalProfile.Certs[1].ExpiryText);

            //set.Bind(lbIncomeInsuredExpiry).To(vm => vm.UserProfile.PersonalProfile.Certs[2].Expiry);

            set.Bind(lbPostcodeCompany).To(vm => vm.UserProfile.CompanyProfile.PostCode);
            set.Bind(lbStateCompany).To(vm => vm.UserProfile.CompanyProfile.State);
            set.Bind(lbUnitCompany).To(vm => vm.UserProfile.CompanyProfile.BulidingNo);
            set.Bind(lbStreetNameCompany).To(vm => vm.UserProfile.CompanyProfile.Street);

            set.Bind(btnIncomeInsured).For(s => s.Selected).To(vm => vm.IsShowIncomeInsuredCert);
            set.Bind(btnFirstAidCert).For(s => s.Selected).To(vm => vm.IsShowFirstAidCert);
            set.Bind(btnGSTRegistered).For(s => s.Selected).To(vm => vm.IsShowGSTRegistered);


            set.Bind(lbFirstAidExpiry).To(vm => vm.UserProfile.PersonalProfile.Certs[3].ExpiryText);
            set.Bind(lbIncomeInsuredExpiry).To(vm => vm.UserProfile.PersonalProfile.Certs[2].ExpiryText);
            set.Bind(ivInComeInsuredStatus).For(s => s.Highlighted).To(vm => vm.IncomeInsured.IsOverdue);
            set.Bind(ivFirstAidStatus).For(s => s.Highlighted).To(vm => vm.FirstAidCertified.IsOverdue);


            set.Bind(btnViewIncomeInsuredPhoto).To(vm => vm.IncomeInsured.ViewDocumentCommand);
            set.Bind(btnViewLicenceTrade).To(vm => vm.TraceLicenseItem.ViewDocumentCommand);
            set.Bind(btnViewContruction).To(vm => vm.ConstructionCardItem.ViewDocumentCommand);
            set.Bind(btnViewFirstAidPhoto).To(vm => vm.FirstAidCertified.ViewDocumentCommand);


            set.Bind(lbPerPublicLiabilityExpiry).To(vm => vm.PerPublicLiabilityCert.CertItem.ExpiryText);
            set.Bind(btnViewPerPublicLiabilityPhoto).To(vm => vm.PerPublicLiabilityCert.ViewDocumentCommand);
            set.Bind(btnPerPublicLiability).For(s => s.Selected).To(vm => vm.IsShowPerPublicLiability);
            set.Bind(ivPerPublicLiabilityStatus).For(s => s.Highlighted).To(vm => vm.PerPublicLiabilityCert.IsOverdue);

            set.Bind(btnAddCompanyDetails).To(vm => vm.AddCompanyDetailsCommand);

            set.Bind(lbBusinessName).To(vm => vm.UserProfile.CompanyProfile.BusinessName);
            set.Bind(lbABN).To(vm => vm.UserProfile.CompanyProfile.ABN);
            set.Bind(lbPositionJob).To(vm => vm.UserProfile.CompanyProfile.JobTitle);

            set.Bind(ivStatusContructorCard).For(s => s.Highlighted).To(vm => vm.ConstructionCardItem.IsOverdue);
            set.Bind(ivStatusTradeLicence).For(s => s.Highlighted).To(vm => vm.TraceLicenseItem.IsOverdue);
            //set.Bind()

            set.Bind(btnSameAddress).For(s => s.Selected).To(vm => vm.IsShowSameAsPersonal);
            set.Bind(btnCompensation).For(s => s.Selected).To(vm => vm.IsShowCompensation);
            set.Bind(btnProductLiability).For(s => s.Selected).To(vm => vm.IsShowProductLiability);
            set.Bind(btnPublicLiability).For(s => s.Selected).To(vm => vm.IsShowPublicLiability);
            set.Bind(btnRegisteredCompany).For(s => s.Selected).To(vm => vm.IsShowGSTRegisterCompany);
            set.Bind(btnDisplayMy).For(s => s.Selected).To(vm => vm.IsShowDisplayMyBusiness);

            set.Bind(lbCompenstationExpiry).To(vm => vm.CompensationCert.CertItem.ExpiryText);
            set.Bind(ivCompenstationStatus).For(s => s.Highlighted).To(vm => vm.CompensationCert.IsOverdue);
            set.Bind(btnViewCompensation).To(vm => vm.CompensationCert.ViewDocumentCommand);

            set.Bind(lbPublicDollar).To(vm => vm.PublicLiabilityCert.CertItem.AmoutText);
            set.Bind(lbPublicLiabilityExpiry).To(vm => vm.PublicLiabilityCert.CertItem.ExpiryText);
            set.Bind(ivPublicLiabilityStatus).For(s => s.Highlighted).To(vm => vm.PublicLiabilityCert.IsOverdue);
            set.Bind(btnViewPublicLiability).To(vm => vm.PublicLiabilityCert.ViewDocumentCommand);

            set.Bind(lbProductDollar).To(vm => vm.ProductLiabilityCert.CertItem.AmoutText);
            set.Bind(lbProductLiabilityExpiry).To(vm => vm.ProductLiabilityCert.CertItem.ExpiryText);
            set.Bind(ivProductLiabilityStatus).For(s => s.Highlighted).To(vm => vm.ProductLiabilityCert.IsOverdue);
            set.Bind(btnViewProductLiability).To(vm => vm.ProductLiabilityCert.ViewDocumentCommand);

            set.Bind(btnEditProfile).For(s => s.Hidden).To(vm => vm.IsShowEditButton).WithConversion("TrueFalse");
            //set.Bind(vDisplay).For(s => s.Hidden).To(vm => vm.IsShowEditButton).WithConversion("TrueFalse");;

            set.Bind(btnEditProfile).To(vm => vm.EditProfileCommand);
            var operationalTableSource = new OperationalCertViewTableViewSource(tbOperationalCert, false, null);

            set.Bind(operationalTableSource).For(s => s.ItemsSource).To(vm => vm.OperationalCert);
            tbOperationalCert.Source = operationalTableSource;

            var licenceTableSource = new LicenceCertViewTableSource(tbLicences, false, null);

            set.Bind(licenceTableSource).For(s => s.ItemsSource).To(vm => vm.LicencesCert);
            tbLicences.Source = licenceTableSource;

            set.Bind(btnBack).To(vm => vm.GoBackCommand);
            set.Apply();

            InitView();
        }
示例#2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            ViewModel.View = this;
            var set = this.CreateBindingSet <EditProfileView, EditProfileViewModel>();

            //binding for personal profile

            set.Bind(tfFirstName).To(vm => vm.FirstName);
            set.Bind(tfLastName).To(vm => vm.LastName);
            set.Bind(tfEmailAddress).To(vm => vm.Email);
            set.Bind(tfDOB).To(vm => vm.DOBText);
            set.Bind(tfMobileNumber).To(vm => vm.MobileNumber);
            set.Bind(tfUnit).To(vm => vm.UnitNumber);
            set.Bind(tfStreetNumber).To(vm => vm.StreetName);
            set.Bind(tfPostCode).To(vm => vm.PostCode);
            set.Bind(tfState).To(vm => vm.State);
            set.Bind(tfFullName).To(vm => vm.NOK);
            set.Bind(tfContactNumber).To(vm => vm.NOKPhone);
            set.Bind(btnIncomeInsured).For(s => s.Selected).To(vm => vm.IsTickIncomeInsured);
            set.Bind(btnFirstAid).For(s => s.Selected).To(vm => vm.IsTickFirstAid);
            set.Bind(btnGSTRegistered).For(s => s.Selected).To(vm => vm.IsTickGSTRegistered);
            set.Bind(btnTickPerPublicLiability).For(s => s.Selected).To(vm => vm.IsTickPerPublicLiability);

            set.Bind(btnIncomeInsured).To(vm => vm.CheckIncomeInsuredCommand);
            set.Bind(btnFirstAid).To(vm => vm.CheckFirstAidCommand);
            set.Bind(btnGSTRegistered).To(vm => vm.CheckGSTRegisteredCommand);
            set.Bind(btnTickPerPublicLiability).To(vm => vm.CheckPerPublicLiablityCommand);

            set.Bind(tfCardNumber).To(vm => vm.ConstructionCardItem.CertItem.Identifier);
            set.Bind(tfCardExpiry).To(vm => vm.ConstructionCardItem.ExpiryText);
            set.Bind(btnDOB).To(vm => vm.DOBCommand);
            set.Bind(tfTypeOfTrade).To(vm => vm.TraceLicenseItem.CertItem.Descriptor);
            set.Bind(tfTradeLicenceNumber).To(vm => vm.TraceLicenseItem.CertItem.Identifier);
            set.Bind(tfTradeLicenceExpiry).To(vm => vm.TraceLicenseItem.ExpiryText);
            set.Bind(btnExpiryConstructionCard).To(vm => vm.ConstructionCardItem.EditExpiryCommand);
            set.Bind(btnExpiryTradeLicence).To(vm => vm.TraceLicenseItem.EditExpiryCommand);
            set.Bind(btnTradeContractor).To(vm => vm.TraceLicenseItem.ViewDocumentCommand);
            set.Bind(btnContractorCard).To(vm => vm.ConstructionCardItem.ViewDocumentCommand);
            set.Bind(btnCheckVerify).For(s => s.Selected).To(vm => vm.IsVerify);
            set.Bind(btnCheckVerify).To(vm => vm.VerifyCommand);
            set.Bind(btnTapAdd).To(vm => vm.TapToAddOperationalCertCommand);
            //set.Bind(btnTradeContractor).For("Title").To(vm => vm.AddTradeContructorText);


            //IncomeInsured
            set.Bind(lbIncomeInsuredExpiry).To(vm => vm.IncomeInsured.ExpiryText);
            set.Bind(btnIncomeInsuredExpiry).To(vm => vm.IncomeInsured.EditExpiryCommand);
            set.Bind(btnViewIncomeInsuredPhoto).To(vm => vm.IncomeInsured.ViewDocumentCommand);
            set.Bind(ivIncomeInsuredStatus).For(s => s.Highlighted).To(vm => vm.IncomeInsured.IsOverdue);

            //FirstAid
            set.Bind(lbFirstAidExpiry).To(vm => vm.FirstAidCertified.ExpiryText);
            set.Bind(btnViewFirstAidPhoto).To(vm => vm.FirstAidCertified.ViewDocumentCommand);
            set.Bind(btnFirstAIdExpiry).To(vm => vm.FirstAidCertified.EditExpiryCommand);
            set.Bind(ivFirstAidStatus).For(s => s.Highlighted).To(vm => vm.FirstAidCertified.IsOverdue);
            //Per Public Liability

            set.Bind(lbPerPublicLiability).To(vm => vm.PerPublicLiability.ExpiryText);
            set.Bind(btnViewPerPublicLiability).To(vm => vm.PerPublicLiability.ViewDocumentCommand);
            set.Bind(btnPerPublicLiablityExpiry).To(vm => vm.PerPublicLiability.EditExpiryCommand);
            set.Bind(ivPerPublicLiabilityStatus).For(s => s.Highlighted).To(vm => vm.PerPublicLiability.IsOverdue);
            //Add Public Liablity

            set.Bind(tfAddPerPublicLiability).To(vm => vm.PerPublicLiability.ExpiryText);
            set.Bind(btnAddPerPublicLiabilityExpiry).To(vm => vm.PerPublicLiability.EditExpiryCommand);
            set.Bind(ivAddPerPublicLiability).For(s => s.LocalPathImage).To(vm => vm.PerPublicLiability.CertItem.Document.LocalMedia);
            set.Bind(btnAddPerPublicLiabilityPhoto).To(vm => vm.PerPublicLiability.ChooseCertPhotoCommand);

            //Add IncomeInsured
            set.Bind(tfAddIncomeInsuredExpiry).To(vm => vm.IncomeInsured.ExpiryText);
            set.Bind(btnAddIncomeInsuredExpiry).To(vm => vm.IncomeInsured.EditExpiryCommand);
            set.Bind(ivAddIncomeInsuredPhoto).For(s => s.LocalPathImage).To(vm => vm.IncomeInsured.CertItem.Document.LocalMedia);
            set.Bind(btnAddIncomeInsuredPhoto).To(vm => vm.IncomeInsured.ChooseCertPhotoCommand);

            //Add First Aid
            set.Bind(tfAddFirstAidExpiry).To(vm => vm.FirstAidCertified.ExpiryText);
            set.Bind(btnAddFirstAidExpiry).To(vm => vm.FirstAidCertified.EditExpiryCommand);
            set.Bind(ivAddFirstAidPhoto).For(s => s.LocalPathImage).To(vm => vm.FirstAidCertified.CertItem.Document.LocalMedia);
            set.Bind(btnAddFirstAidPhoto).To(vm => vm.FirstAidCertified.ChooseCertPhotoCommand);

            var operationalCertTableSource = new OperationalCertViewTableViewSource(tbOperationalCert, true, this);

            set.Bind(operationalCertTableSource).For(s => s.ItemsSource).To(vm => vm.OperationalCerts);
            tbOperationalCert.Source = operationalCertTableSource;

            var newoperationalCertTableSource = new OperationalCertTableViewSource(tbNewOperationalCert, null, this);

            set.Bind(newoperationalCertTableSource).For(s => s.ItemsSource).To(vm => vm.NewOperationalCerts);
            tbNewOperationalCert.Source = newoperationalCertTableSource;

            //binding for company profile



            set.Bind(tfCPbusinessName).To(vm => vm.CPBusinessName);
            set.Bind(tfCPABN).To(vm => vm.CPABN);
            set.Bind(tfCPPosition).To(vm => vm.CPPositionJobTitle);
            set.Bind(tfCPUnit).To(vm => vm.CPUnitNumber);
            set.Bind(tfCPStreet).To(vm => vm.CPStreetName);
            set.Bind(tfCPPostCode).To(vm => vm.CPPostCode);
            set.Bind(tfCPState).To(vm => vm.CPState);

            set.Bind(btnCPGSTRegistered).For(s => s.Selected).To(vm => vm.IsTickGSTRegistedCompany);
            set.Bind(btnCPCompensation).For(s => s.Selected).To(vm => vm.IsTickCompensation);
            set.Bind(btnCPPublicLiability).For(s => s.Selected).To(vm => vm.IsTickPublicLiability);
            set.Bind(btnCPProductLiability).For(s => s.Selected).To(vm => vm.IsTickProductLiability);
            set.Bind(btnCPSameAsPer).For(s => s.Selected).To(vm => vm.IsShowSameAsPersonal);
            set.Bind(btnCPVerify).For(s => s.Selected).To(vm => vm.IsCPVerify);
            set.Bind(btnCPDisplay).For(s => s.Selected).To(vm => vm.IsShowDisplayMyBusiness);

            set.Bind(btnCPGSTRegistered).To(vm => vm.CheckGSTRegisteredCompanyCommand);
            set.Bind(btnCPCompensation).To(vm => vm.CheckCompensationCommand);
            set.Bind(btnCPPublicLiability).To(vm => vm.CheckPublicLiabilityCommand);
            set.Bind(btnCPProductLiability).To(vm => vm.CheckProductLiabilityCommand);
            set.Bind(btnCPSameAsPer).To(vm => vm.CheckSameAsAddressCommand);
            set.Bind(btnCPDisplay).To(vm => vm.CheckDisplayMyBusinessCommand);
            set.Bind(btnCPVerify).To(vm => vm.CheckVerifyCompanyCommand);
            set.Bind(btnCPTapAddMore).To(vm => vm.TapToAddLicencesCommand);

            set.Bind(tfWorkeCompenstationExpiry).To(vm => vm.CompensationCert.ExpiryText);
            set.Bind(btnViewWorksCompenPhoto).To(vm => vm.CompensationCert.ViewDocumentCommand);
            set.Bind(ivWorksCompenstationPhoto).For(s => s.Highlighted).To(vm => vm.CompensationCert.IsOverdue);
            set.Bind(btnWorkCompenstationExpiry).To(vm => vm.CompensationCert.EditExpiryCommand);


            set.Bind(tfPublicLiabilityExpiry).To(vm => vm.PublicLiabilityCert.ExpiryText);
            set.Bind(tfCPPublicLiabilityDollar).To(vm => vm.PublicLiabilityCert.AmountText);
            set.Bind(btnViewPublicLiabilityPhoto).To(vm => vm.PublicLiabilityCert.ViewDocumentCommand);
            set.Bind(ivPublicLiabilityStatus).For(s => s.Highlighted).To(vm => vm.PublicLiabilityCert.IsOverdue);
            set.Bind(btnPublicLiabilityExpiry).To(vm => vm.PublicLiabilityCert.EditExpiryCommand);

            set.Bind(tfProductLiabilityExpiry).To(vm => vm.ProductLiabilityCert.ExpiryText);
            set.Bind(tfCPProductLiability).To(vm => vm.ProductLiabilityCert.AmountText);
            set.Bind(btnViewProductLiabilityPhoto).To(vm => vm.ProductLiabilityCert.ViewDocumentCommand);
            set.Bind(ivProductLiabilityStatus).For(s => s.Highlighted).To(vm => vm.ProductLiabilityCert.IsOverdue);
            set.Bind(btnProductLiabilityExpiry).To(vm => vm.ProductLiabilityCert.EditExpiryCommand);


            set.Bind(ivContructionStatus).For(s => s.Highlighted).To(vm => vm.ConstructionCardItem.IsOverdue);
            set.Bind(ivTradeLicencesStatus).For(s => s.Highlighted).To(vm => vm.TraceLicenseItem.IsOverdue);

            set.Bind(tfTypeOfTradeAdd).To(vm => vm.TraceLicenseItem.CertItem.Descriptor);
            set.Bind(tfTradeLicenceAdd).To(vm => vm.TraceLicenseItem.CertItem.Identifier);
            set.Bind(tfLicenceExpiryDateAdd).To(vm => vm.TraceLicenseItem.ExpiryText);

            //Add new trade
            set.Bind(btnLicenceExpiryDateAdd).To(vm => vm.TraceLicenseItem.EditExpiryCommand);
            set.Bind(btnLicencePhotoAdd).To(vm => vm.TraceLicenseItem.ChooseCertPhotoCommand);
            set.Bind(ivLicencePhotoAdd).For(s => s.LocalPathImage).To(vm => vm.TraceLicenseItem.LocalPathImage);

            //Add new Compenstation
            set.Bind(tfAddWorkCompenstationExpiry).To(vm => vm.CompensationCert.ExpiryText);
            set.Bind(btnAddWorkCompenstationExpiry).To(vm => vm.CompensationCert.EditExpiryCommand);
            set.Bind(ivAddPhotoWorkCompenstation).For(s => s.LocalPathImage).To(vm => vm.CompensationCert.CertItem.Document.LocalMedia);
            set.Bind(btnAddPhotoWorkCompenstation).To(vm => vm.CompensationCert.ChooseCertPhotoCommand);

            //Add new PublicLiability

            set.Bind(tfAddPublicLiabilityExpiry).To(vm => vm.PublicLiabilityCert.ExpiryText);
            set.Bind(btnAddPubicliablityExpiry).To(vm => vm.PublicLiabilityCert.EditExpiryCommand);
            set.Bind(tfAddPublicLiabilityDollar).To(vm => vm.PublicLiabilityCert.AmountText);
            set.Bind(ivAddPublicLiabilityPhoto).For(s => s.LocalPathImage).To(vm => vm.PublicLiabilityCert.CertItem.Document.LocalMedia);
            set.Bind(btnAddPublicLiabilityPhoto).To(vm => vm.PublicLiabilityCert.ChooseCertPhotoCommand);

            //Add Product

            set.Bind(tfAddProductLiabilityExpiry).To(vm => vm.ProductLiabilityCert.ExpiryText);
            set.Bind(btnAddProductLiabilityExpiry).To(vm => vm.ProductLiabilityCert.EditExpiryCommand);
            set.Bind(tfAddProducLiabilityDollar).To(vm => vm.ProductLiabilityCert.AmountText);
            set.Bind(ivAddProductLiabilityPhoto).For(s => s.LocalPathImage).To(vm => vm.ProductLiabilityCert.CertItem.Document.LocalMedia);
            set.Bind(btnAddProductLiabilityPhoto).To(vm => vm.ProductLiabilityCert.ChooseCertPhotoCommand);

            var licencesTableSource = new LicenceCertViewTableSource(tbCPLicences, true, this);

            set.Bind(licencesTableSource).For(s => s.ItemsSource).To(vm => vm.LicencesCert);
            tbCPLicences.Source = licencesTableSource;

            var newLicencesTableSource = new LicencesCertTableViewSource(tbCPNewLicences, null, this);

            set.Bind(newLicencesTableSource).For(s => s.ItemsSource).To(vm => vm.NewLicences);
            tbCPNewLicences.Source = newLicencesTableSource;

            set.Bind(btnSave).To(vm => vm.SaveCommand);
            btnSaveTime.TouchUpInside += BtnSaveTime_TouchUpInside;
            btnCancel.TouchUpInside   += BtnCancel_TouchUpInside;
            set.Bind(btnBack).To(vm => vm.GoBackCommand);
            InitView();
            ImplementKeyboard();
            set.Apply();
        }