5using System.ComponentModel;
11 #region Bindable Properties
21 public Microsoft.Maui.Font
Font
107 BindableProperty.Create(nameof(PickerStyle), typeof(Style), typeof(
CompositePicker),
null);
109 public Style PickerStyle
115 public static readonly BindableProperty ItemsSourceProperty =
116 BindableProperty.Create(nameof(ItemsSource), typeof(IList), typeof(
CompositePicker),
null);
118 public IList ItemsSource
120 get => (IList)this.GetValue(ItemsSourceProperty);
121 set => this.SetValue(ItemsSourceProperty, value);
124 public static readonly BindableProperty SelectedItemProperty =
125 BindableProperty.Create(nameof(SelectedItem), typeof(
object), typeof(
CompositePicker),
null, BindingMode.TwoWay);
127 public object SelectedItem
129 get => (object)this.GetValue(SelectedItemProperty);
130 set => this.SetValue(SelectedItemProperty, value);
133 public BindingBase ItemDisplayBinding
135 get => this.picker.ItemDisplayBinding;
136 set => this.picker.ItemDisplayBinding = value;
143 private readonly Picker picker;
154 this.picker =
new Picker();
156 this.picker.SetBinding(Picker.TitleProperty,
new Binding(nameof(this.
Placeholder), source:
this));
157 this.picker.SetBinding(Picker.TextColorProperty,
new Binding(nameof(this.
TextColor), source:
this));
159 this.picker.SetBinding(Picker.HorizontalTextAlignmentProperty,
new Binding(nameof(this.
XAlign), source:
this));
160 this.picker.SetBinding(Picker.StyleProperty,
new Binding(nameof(this.PickerStyle), source:
this));
161 this.picker.SetBinding(Picker.SelectedItemProperty,
new Binding(nameof(this.SelectedItem), source:
this, mode: BindingMode.TwoWay));
162 this.picker.SetBinding(Picker.ItemsSourceProperty,
new Binding(nameof(this.ItemsSource), source:
this));
164 this.CenterView = this.picker;
static readonly BindableProperty TextColorProperty
The TextColor property
static readonly BindableProperty HasBorderProperty
The HasBorder property
static readonly BindableProperty PlaceholderTextColorProperty
The PlaceholderTextColor property
bool HasBorder
Gets or sets if the border should be shown or not
string Placeholder
Get or sets the PlaceHolder
TextAlignment XAlign
Gets or sets the X alignment of the text
static readonly BindableProperty FontProperty
The font property
static readonly BindableProperty PlaceholderProperty
The Placeholder property
static readonly BindableProperty PickerStyleProperty
Bindable property for the style applied to the picker
Color TextColor
Gets or sets the TextColor
Microsoft.Maui.Font Font
Gets or sets the Font
static readonly BindableProperty XAlignProperty
The XAlign property
Color PlaceholderTextColor
Sets color for placeholder text