public MaterialDatePickerListener( MaterialDatePicker materialDatePicker, Action action) { _materialDatePicker = materialDatePicker; _action = action; }
protected override void OnElementChanged(ElementChangedEventArgs <Xamarin.Forms.DatePicker> e) { base.OnElementChanged(e); if (e?.NewElement != null) { _materialDatePicker = Element as MaterialDatePicker; SetControl(); } }
private void DateEditTextOnFocusChange(object sender, View.FocusChangeEventArgs e) { if (e.HasFocus) { _datePicker = MaterialDatePicker.Builder.DatePicker().Build(); _datePicker.Show(ChildFragmentManager, _datePicker.Tag); _datePicker.AddOnDismissListener(new MaterialDatePickerListener(_datePicker, () => _dateEditText.ClearFocus())); _datePicker.AddOnPositiveButtonClickListener(this); } }