public void OnClick(object sender, EventArgs e) { HideKeyboard(); _dialog = new TimePickerDialog(Context, this, blankPicker.Time.Hours, blankPicker.Time.Minutes, true); _dialog.SetButton(blankPicker.DoneButtonText, (k, p) => { }); _dialog.SetButton2(blankPicker.CancelButtonText, (k, p) => { EController.SetValueFromRenderer(VisualElement.IsFocusedProperty, false); Control.ClearFocus(); HideKeyboard(); blankPicker.SendCancelClicked(); }); _dialog.CancelEvent += _dialog_DismissEvent; _dialog.Show(); }
public void OnPickerClick(object sender, EventArgs e) { _dialog = new TimePickerDialog(Context, (s, d) => { EController.SetValueFromRenderer(Xamarin.Forms.TimePicker.TimeProperty, new TimeSpan(d.HourOfDay, d.Minute, 0)); EController.SetValueFromRenderer(VisualElement.IsFocusedPropertyKey, false); Control.ClearFocus(); _dialog = null; }, this.Element.Time.Hours, this.Element.Time.Minutes, true); _dialog.SetButton(blankPicker.CancelButtonText, (s, el) => { blankPicker.SendCancelClicked(); }); _dialog.SetButton2(blankPicker.DoneButtonText, (k, p) => { this.Control.Text = Element.Time.ToString(Element.Format); blankPicker.SendDoneClicked(); }); _dialog.Show(); }
public void UpdateTextButton(int buttonIndex, string text) { _dialog?.SetButton(buttonIndex, text, (sender, e) => { }); }