Inheritance: UITextField
		public PickerElement (string caption, object[] Items , string DisplayMember, DialogViewController dvc) : base (caption, null, null) 
		{
			this.Dvc = dvc;
			this.ComboBox = new UIComboBox(RectangleF.Empty);
			this.ComboBox.Items = Items;
			this.ComboBox.DisplayMember = DisplayMember;
			this.ComboBox.TextAlignment = UITextAlignment.Right;
			this.ComboBox.BorderStyle = UITextBorderStyle.None;
			this.ComboBox.PickerClosed += delegate {
				if (Dvc != null && doneButtonVisible) {
					Dvc.NavigationItem.RightBarButtonItem = oldRightBtn;					
					doneButtonVisible = false;
				}
				RestoreTableView();
			};
			this.ComboBox.ValueChanged += delegate {
				Value = ComboBox.Text;
				RefreshValue();
				if (ValueChanged != null) {
					ValueChanged(this, null);
				}
			};
			this.ComboBox.PickerFadeInDidFinish += delegate {
				if (modifiedHeightOffset == 0f && !ComboBox.IsHiding) {
					// adjust size.
					var ff = Dvc.TableView.Frame;
					modifiedHeightOffset = 200f;
					Dvc.TableView.Frame = new RectangleF(ff.X, ff.Y, ff.Width, ff.Height - modifiedHeightOffset);
					Dvc.TableView.ScrollToRow (IndexPath, UITableViewScrollPosition.Middle, true);
				}
			};
			Value = ComboBox.Text;
		}
Ejemplo n.º 2
0
 public ComboBoxElement(string caption, object[] Items, string DisplayMember) : base(caption, "")
 {
     this.ComboBox               = new UIComboBox(RectangleF.Empty);
     this.ComboBox.Items         = Items;
     this.ComboBox.DisplayMember = DisplayMember;
     this.ComboBox.TextAlignment = UITextAlignment.Right;
     this.ComboBox.BorderStyle   = UITextBorderStyle.None;
     this.ComboBox.PickerClosed += delegate {
         Dvc.NavigationItem.RightBarButtonItem = oldRightBtn;
     };
     this.ComboBox.ValueChanged += delegate {
         Value = ComboBox.Text;
     };
     Value = ComboBox.Text;
 }
Ejemplo n.º 3
0
 public ComboBoxElement(string caption, object[] Items , string DisplayMember)
     : base(caption,"")
 {
     this.ComboBox = new UIComboBox(RectangleF.Empty);
     this.ComboBox.Items = Items;
     this.ComboBox.DisplayMember = DisplayMember;
     this.ComboBox.TextAlignment = UITextAlignment.Right;
     this.ComboBox.BorderStyle = UITextBorderStyle.None;
     this.ComboBox.PickerClosed += delegate {
         Dvc.NavigationItem.RightBarButtonItem = oldRightBtn;
     };
     this.ComboBox.ValueChanged += delegate {
         Value = ComboBox.Text;
     };
     Value = ComboBox.Text;
 }