public void initRegisterScreenView(){ registerScreenView=new RegisterScreenView (listcountry,liststateandprovince); registerScreenView.createAccountBtn.TouchUpInside += (s, e) => { CreateAccountClick(); }; registerScreenView.ScanBtn.TouchUpInside += (s, e) => { ScanClick(); }; if (!String.IsNullOrEmpty (email)) { registerScreenView.emailTextField.Text = email; } if (!String.IsNullOrEmpty (phone)) { registerScreenView.mobilePhoneTextField.Text = phone; } ((SearchTableViewSource)registerScreenView.searchTableView.Source).RegisterScreenController = this; registerScreenView.address1TextField.EditingChanged+= (s, e) => { if(registerScreenView.address1TextField.Text.Length>3&&!searching){ searching=true; registerScreenView.searchTableView.Hidden=true; ThreadPool.QueueUserWorkItem(SuggestList); } }; //put default country and province( if we find one) if (!String.IsNullOrEmpty (GlobalVariable.currentlocation)) { foreach (var x in liststateandprovince) { if (x.state_province_name == GlobalVariable.currentlocation) { foreach (var y in listcountry) { if (y.country_code == x.country_code) { ((CustomPickerModel<Country>)registerScreenView.countryPickerView.pickerView.Model).selectedObject = y; registerScreenView.countryTextField.Text = y.country_name; registerScreenView.subliststateandprovince.Clear(); foreach(var z in liststateandprovince) { if(z.country_code==y.country_code) { registerScreenView.subliststateandprovince.Add(z); } } registerScreenView.provincePickerView.newModel( new ProvincePickerModel<StateAndProvince>(registerScreenView.subliststateandprovince.ToArray())); ((CustomPickerModel<StateAndProvince>)registerScreenView.provincePickerView.pickerView.Model).selectedObject = x; registerScreenView.provanceTextField.Text = x.state_province_name; } } } } } //put default Communicate Raffle Results and Recieves Charity Updates ((CustomPickerModel<string>)registerScreenView.raffleResultsPickerView.pickerView.Model).selectedObject = registerScreenView.listRaffleResultContactMethod[0]; registerScreenView.raffleResultTextField.Text = registerScreenView.listRaffleResultContactMethod[0]; ((CustomPickerModel<string>)registerScreenView.CharityMarketingMessagesPickerView.pickerView.Model).selectedObject = registerScreenView.listCharityMarketingMessageContactMethod[0]; registerScreenView.CharityMarketingMessagesTextField.Text = registerScreenView.listCharityMarketingMessageContactMethod[0]; View.Add(registerScreenView); }
public void initRegisterScreenView() { registerScreenView=new RegisterScreenView (listcountry,liststateandprovince); registerScreenView.createAccountBtn.TouchUpInside += (s, e) => { CreateAccountClick(); }; if (!String.IsNullOrEmpty (email)) { registerScreenView.emailTextField.Text = email; } //put default country and province( if we find one) if (!String.IsNullOrEmpty (GlobalVariable.currentlocation)) { foreach (var x in liststateandprovince) { if (x.state_province_name == GlobalVariable.currentlocation) { foreach (var y in listcountry) { if (y.country_code == x.country_code) { ((CustomPickerModel<Country>)registerScreenView.countryPickerView.pickerView.Model).selectedObject = y; registerScreenView.countryTextField.Text = y.country_name; registerScreenView.subliststateandprovince.Clear(); foreach(var z in liststateandprovince) { if(z.country_code==y.country_code) { registerScreenView.subliststateandprovince.Add(z); } } registerScreenView.provincePickerView.newModel( new ProvincePickerModel<StateAndProvince>(registerScreenView.subliststateandprovince.ToArray())); ((CustomPickerModel<StateAndProvince>)registerScreenView.provincePickerView.pickerView.Model).selectedObject = x; registerScreenView.provanceTextField.Text = x.state_province_name; } } } } } //put default Communicate Raffle Results and Recieves Charity Updates ((CustomPickerModel<string>)registerScreenView.raffleResultsPickerView.pickerView.Model).selectedObject = registerScreenView.listRaffleResultContactMethod[0]; registerScreenView.raffleResultTextField.Text = registerScreenView.listRaffleResultContactMethod[0]; ((CustomPickerModel<string>)registerScreenView.CharityMarketingMessagesPickerView.pickerView.Model).selectedObject = registerScreenView.listCharityMarketingMessageContactMethod[0]; registerScreenView.CharityMarketingMessagesTextField.Text = registerScreenView.listCharityMarketingMessageContactMethod[0]; View.Add(registerScreenView); }