Пример #1
0
        public UIComboBox(CGRect rect) : base(rect)
        {
            //this.BorderStyle = UITextBorderStyle.RoundedRect;
            this.BackgroundColor = UIColor.Clear;
            pickerView           = new PickerView()
            {
                Frame = new CGRect(0, 40, 320, 480),
            };
            this.TouchDown += delegate { ShowPicker(); };
//			pickerView.TintColor =Style.Colors.AccentColor.Value;

            //pickerView.BackgroundColor = UIColor.Black;
            pickerView.Opaque = true;
//			pickerView.BackgroundColor =Style.Current.ScreensDefaults.Cell.Background.Value;

            pickerView.IndexChanged += delegate
            {
                var oldValue = this.Text;
                this.Text = pickerView.StringValue;
                if (ValueChanged != null && oldValue != Text)
                {
                    ValueChanged(this, null);
                }
            };
        }
Пример #2
0
        public override string GetTitle(UIPickerView uipv, nint row, nint comp)
        {
            //each component would get its own title.

            var theObject = Picker.Items[row];

            if (string.IsNullOrEmpty(Picker.DisplayMember))
            {
                return(theObject.ToString());
            }
            return(PickerView.GetPropertyValue(theObject, Picker.DisplayMember));
        }
Пример #3
0
 public PickerData(PickerView picker)
 {
     Picker = picker;
 }