Exemple #1
0
        private void ShowDatePicker()
        {
            _isShowing = true;

            _dialog = new DatePickerDialog(Context, DatePicker_DateSet, Element.Date.Year, Element.Date.Month - 1, Element.Date.Day);

            _dialog.SetButton("Done", (sender, e) =>
            {
                Element.SelectedDate = _dialog.DatePicker.DateTime;
                Element.UpdateDate();
                SetText();
            });

            _dialog.SetButton2("Cancel", (sender, e) =>
            {
                _dialog.Hide();
            });

            _dialog.SetButton3("Clear", (sender, e) =>
            {
                Element.SelectedDate = null;
                Element.UpdateDate();
                SetText();
            });

            _dialog.DatePicker.DateTime = Element.SelectedDate ?? DateTime.Now;
            _dialog.DismissEvent       += (sender, args) => _isShowing = false;
            _dialog.Show();
        }
Exemple #2
0
        protected override void Dispose(bool disposing)
        {
            if (disposing && !_disposed)
            {
                DeviceDisplay.MainDisplayInfoChanged -= DeviceInfoPropertyChanged;

                _disposed = true;
                if (_dialog != null)
                {
                    _dialog.CancelEvent -= OnCancelButtonClicked;
                    _dialog.Hide();
                    _dialog.Dispose();
                    _dialog = null;
                }
            }
            base.Dispose(disposing);
        }
        protected override void Dispose(bool disposing)
        {
            if (disposing && !_disposed)
            {
                if (Forms.IsLollipopOrNewer)
                {
                    Device.Info.PropertyChanged -= DeviceInfoPropertyChanged;
                }

                _disposed = true;
                if (_dialog != null)
                {
                    if (Forms.IsLollipopOrNewer)
                    {
                        _dialog.CancelEvent -= OnCancelButtonClicked;
                    }

                    _dialog.Hide();
                    _dialog.Dispose();
                    _dialog = null;
                }
            }
            base.Dispose(disposing);
        }
        protected override void Dispose(bool disposing)
        {
            if (Control != null)
            {
                this.Control.Click -= OnPickerClick;

                if (_dialog != null)
                {
                    _dialog.Hide();
                    _dialog.Dispose();
                    _dialog = null;
                }
            }

            base.Dispose(disposing);
        }
        protected override void Dispose(bool disposing)
        {
            if (Control != null)
            {
                Control.Click       -= OnPickerClick;
                Control.FocusChange -= OnPickerFocusChange;

                if (_dialog != null)
                {
                    _dialog.Hide();
                    _dialog.Dispose();
                    _dialog = null;
                }
            }

            base.Dispose(disposing);
        }
Exemple #6
0
        protected override void Dispose(bool disposing)
        {
            if (Control != null)
            {
                Control.Click -= Picker_Click;
                //Control.FocusChange -= Picker_FocusChanged;
            }

            if (_dialog != null)
            {
                _dialog.Hide();
                _dialog.Dispose();
                _dialog = null;
            }

            base.Dispose(disposing);
        }
Exemple #7
0
 void HidePickerDialog()
 {
     _dialog?.Hide();
 }