public RaffleListSource(RaffleListScreenController RaffleListScreenController) { //this.eventlist = eventlist; //this.eventImageList = eventImageList; this.haveContractEventlist = new List<Tap5050Event> (); this.noContractEventlist = new List<Tap5050Event> (); this.hashTable = new Hashtable (); this.RaffleListScreenController = RaffleListScreenController; for (int i=0;i<Global.eventlist.Count;i++) { if (Global.eventlist[i].have_contract == "Y") { this.haveContractEventlist.Add (Global.eventlist[i]); hashTable.Add("haveContractEventlist,"+this.haveContractEventlist.IndexOf(Global.eventlist[i]),i); } else { this.noContractEventlist.Add (Global.eventlist[i]); hashTable.Add("noContractEventlist,"+this.noContractEventlist.IndexOf(Global.eventlist[i]),i); } } }
public RaffleListScreenView(RaffleListScreenController RaffleListScreenController,List<Tap5050Event> eventlist,List<UIImage> eventImageList) { BackgroundColor = UIColor.FromRGB (235, 235, 235); //basic info GUI************************************************** confirmedBtn=UIButton.FromType(UIButtonType.RoundedRect); confirmedBtn.BackgroundColor = UIColor.Clear; confirmedBtn.SetTitle (RaffleListScreenData.TableViewFirstHeaderText, UIControlState.Normal); confirmedBtn.SetTitleColor (UIColor.Black, UIControlState.Normal); Add(confirmedBtn); PotentialBtn=UIButton.FromType(UIButtonType.RoundedRect); PotentialBtn.BackgroundColor = UIColor.Clear; PotentialBtn.SetTitle (RaffleListScreenData.TableViewSecondHeaderText, UIControlState.Normal); PotentialBtn.SetTitleColor (UIColor.Black, UIControlState.Normal); Add(PotentialBtn); ConfirmedBarView= new UIView () { BackgroundColor=UIColor.FromRGB (245, 245, 245), }; Add (ConfirmedBarView); PotentialBarView= new UIView () { BackgroundColor=UIColor.FromRGB (245, 245, 245), }; Add (PotentialBarView); RaffleListTableView = new UITableView () { Source=new RaffleListSource(RaffleListScreenController), SeparatorColor=UIColor.Clear, BackgroundColor=UIColor.Clear, }; Add (RaffleListTableView); LocationLabel= new UILabel () { Text=RaffleListScreenData.LocationLabelText, TextAlignment=UITextAlignment.Left, TextColor = UIColor.Gray, BackgroundColor=UIColor.Clear, }; Add(LocationLabel); //*************************************************************** ScrollView = new UIScrollView () { BackgroundColor=UIColor.White, }; Add (ScrollView); noRaffleTextLable= new UITextView () { Text=RaffleListScreenData.NoRaffleText, TextColor = UIColor.Black, TextAlignment=UITextAlignment.Center, Editable=false, BackgroundColor=UIColor.Clear, ScrollEnabled=false }; ScrollView.Add(noRaffleTextLable); organizationNameTextField= new UITextField( ) { Placeholder = RaffleListScreenData.organizationNameTextFieldPlaceholder, Text = "", ClearButtonMode=UITextFieldViewMode.Always, KeyboardType=UIKeyboardType.Default, ReturnKeyType=UIReturnKeyType.Done, TextColor = UIColor.Black, BackgroundColor = UIColor.Clear, BorderStyle = UITextBorderStyle.RoundedRect, Enabled = true, }; organizationNameTextField.ShouldReturn += (textField) => { textField.ResignFirstResponder(); return true; }; ScrollView.Add(organizationNameTextField); phoneNumberTextField= new UITextField( ) { Placeholder = RaffleListScreenData.phoneNumberTextFieldPlaceholder, Text = "", ClearButtonMode=UITextFieldViewMode.Always, KeyboardType=UIKeyboardType.Default, ReturnKeyType=UIReturnKeyType.Done, TextColor = UIColor.Black, BackgroundColor = UIColor.Clear, BorderStyle = UITextBorderStyle.RoundedRect, Enabled = true, }; phoneNumberTextField.ShouldReturn += (textField) => { textField.ResignFirstResponder(); return true; }; ScrollView.Add(phoneNumberTextField); sentBtn =new CustomBtn(); sentBtn.SetTitle (RaffleListScreenData.sentBtnTitle, UIControlState.Normal); sentBtn.SetTitleColor (UIColor.White, UIControlState.Normal); ScrollView.Add(sentBtn); //move the view when the keyboard is up NSNotificationCenter.DefaultCenter.AddObserver (UIKeyboard.DidShowNotification,KeyBoardUpNotification); Rotate (); }