private void ExtendedDatePicker_Focused(object sender, FocusEventArgs e)
        {
            try
            {
                var param = FocusedCommandParameter ?? e.IsFocused;

                if (FocusedCommand != null && FocusedCommand.CanExecute(param))
                {
                    FocusedCommand.Execute(param);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Default Constructor
        /// </summary>
        public AdvancedEntry()
        {
            txtInput = GetInputEntry();
            this.Children.Add(lblTitle);
            this.Children.Add(frmBackground);

            ApplyValidationPosition(GlobalSetting.LabelPosition);

            frmBackground.Content = new Grid
            {
                BackgroundColor = Color.Transparent,
                Children        =
                {
                    new StackLayout
                    {
                        Orientation     = StackOrientation.Horizontal,
                        BackgroundColor = Color.Transparent,
                        Children        =
                        {
                            imgIcon,
                            txtInput
                        }
                    },
                    imgWarning
                }
            };

            txtInput.TextChanged += TxtInput_TextChanged;
            txtInput.Completed   += (s, args) => { ExecuteCommand(); Completed?.Invoke(this, new EventArgs()); FocusNext(); };
            txtInput.Focused     += (s, args) => { var arg = new FocusEventArgs(this, true); FocusedCommand?.Execute(arg); Focused?.Invoke(this, arg); };
            txtInput.Unfocused   += (s, args) => { var arg = new FocusEventArgs(this, false); UnfocusedCommand?.Execute(arg); Unfocused?.Invoke(this, arg); };
            imgWarning.IsVisible  = this.IsRequired;
            Reset();
        }
Exemplo n.º 3
0
 private void Bindable_Focused(object sender, FocusEventArgs e)
 {
     FocusedCommand?.Execute(null);
 }