public ShippingAddressViewController (User user) { Title = "Shipping"; //This hides the back button text when you leave this View Controller NavigationItem.BackBarButtonItem = new UIBarButtonItem ("", UIBarButtonItemStyle.Plain, handler: null); this.user = user; TableView.SeparatorStyle = UITableViewCellSeparatorStyle.None; Cells.Add (new CustomViewCell (FirstNameField = new TextEntryView { PlaceHolder = "First Name", Value = user.FirstName, })); Cells.Add (new CustomViewCell (LastNameField = new TextEntryView { PlaceHolder = "Last Name", Value = user.LastName, })); Cells.Add (new CustomViewCell (PhoneNumberField = new TextEntryView { PlaceHolder = "Phone Number", Value = user.Phone, KeyboardType = UIKeyboardType.NumberPad, })); Cells.Add (new CustomViewCell (AddressField = new TextEntryView { PlaceHolder = "Address", Value = user.Address, AutocapitalizationType = UITextAutocapitalizationType.Words, })); Cells.Add (new CustomViewCell (Address2Field = new TextEntryView { PlaceHolder = "Address", Value = user.Address2, AutocapitalizationType = UITextAutocapitalizationType.Words, })); Cells.Add (new CustomViewCell (CityField = new TextEntryView { PlaceHolder = "City", Value = user.City, AutocapitalizationType = UITextAutocapitalizationType.Words, })); Cells.Add (new CustomViewCell (PostalField = new TextEntryView { PlaceHolder = "Postal Code", Value = user.ZipCode, KeyboardType = UIKeyboardType.NumbersAndPunctuation, })); Cells.Add (new CustomViewCell (CountryField = new AutoCompleteTextEntry { PlaceHolder = "Country", Title = "Select your Country", Value = user.Country, ValueChanged = (v) => GetStates (), PresenterView = this, })); Cells.Add (new CustomViewCell (StateField = new AutoCompleteTextEntry { PlaceHolder = "State", Value = user.State, Title = "Select your state", PresenterView = this, })); GetCountries (); GetStates (); TableView.Source = new ShippingAddressPageSource { Cells = Cells }; TableView.TableFooterView = new UIView (new RectangleF (0, 0, 0, BottomButtonView.Height)); TableView.ReloadData (); View.AddSubview (BottomView = new BottomButtonView () { ButtonText = "Place Order", ButtonTapped = PlaceOrder, }); }
public ShippingAddressViewController(User user) { this.Title = "Shipping"; //This hides the back button text when you leave this View Controller this.NavigationItem.BackBarButtonItem = new UIBarButtonItem("", UIBarButtonItemStyle.Plain, handler: null); this.user = user; TableView.SeparatorStyle = UITableViewCellSeparatorStyle.None; Cells.Add(new CustomViewCell(FirstNameField = new TextEntryView { PlaceHolder = "First Name", Value = user.FirstName, })); Cells.Add(new CustomViewCell(LastNameField = new TextEntryView { PlaceHolder = "Last Name", Value = user.LastName, })); Cells.Add(new CustomViewCell(PhoneNumberField = new TextEntryView { PlaceHolder = "Phone Number", Value = user.Phone, KeyboardType = UIKeyboardType.NumberPad, })); Cells.Add(new CustomViewCell(AddressField = new TextEntryView { PlaceHolder = "Address", Value = user.Address, AutocapitalizationType = UITextAutocapitalizationType.Words, })); Cells.Add(new CustomViewCell(Address2Field = new TextEntryView { PlaceHolder = "Address", Value = user.Address2, AutocapitalizationType = UITextAutocapitalizationType.Words, })); Cells.Add(new CustomViewCell(CityField = new TextEntryView { PlaceHolder = "City", Value = user.City, AutocapitalizationType = UITextAutocapitalizationType.Words, })); Cells.Add(new CustomViewCell(PostalField = new TextEntryView { PlaceHolder = "Postal Code", Value = user.ZipCode, KeyboardType = UIKeyboardType.NumbersAndPunctuation, })); Cells.Add(new CustomViewCell(CountryField = new AutoCompleteTextEntry { PlaceHolder = "Country", Title = "Select your Country", Value = user.Country, ValueChanged = (v) => GetStates(), PresenterView = this, })); Cells.Add(new CustomViewCell(StateField = new AutoCompleteTextEntry { PlaceHolder = "State", Value = user.State, Title = "Select your state", PresenterView = this, })); GetCountries(); GetStates(); TableView.Source = new ShippingAddressPageSource { Cells = Cells }; TableView.TableFooterView = new UIView(new RectangleF(0, 0, 0, BottomButtonView.Height)); TableView.ReloadData(); View.AddSubview(BottomView = new BottomButtonView() { ButtonText = "Place Order", ButtonTapped = PlaceOrder, }); }