コード例 #1
0
        protected virtual void Setup(ExtEntry entry)
        {
            this.Control.ImeOptions = this.GetValueFromDescription(entry.ReturnKeyType);
            this.Control.SetImeActionLabel(entry.ReturnKeyType.ToString(), this.Control.ImeOptions);
            this.Control.EditorAction += (sender, args) =>
            {
                entry.OnNext();

                if (entry.ReturnCommand != null && entry.ReturnCommand.CanExecute(null))
                {
                    entry.ReturnCommand.Execute(null);
                }
            };
        }
コード例 #2
0
        protected virtual void Setup(ExtEntry entry)
        {
            //this.Control.ClearButtonMode = UITextFieldViewMode.UnlessEditing;
            this.Control.ReturnKeyType = this.GetValueFromDescription(entry.ReturnKeyType);
            this.Control.ShouldReturn += txt =>
            {
                entry.OnNext();
                if (entry.ReturnCommand != null && entry.ReturnCommand.CanExecute(null))
                {
                    entry.ReturnCommand.Execute(null);
                }

                return(true);
            };
        }
コード例 #3
0
        protected virtual void Setup(ExtEntry entry)
        {
            this.Control.KeyDown += (sender, args) =>
            {
                switch (args.Key)
                {
                case VirtualKey.Tab:
                    entry.OnNext();
                    args.Handled = true;
                    break;

                case VirtualKey.Enter:
                    entry.OnNext();
                    if (entry.ReturnCommand != null && entry.ReturnCommand.CanExecute(null))
                    {
                        entry.ReturnCommand.Execute(null);
                    }

                    args.Handled = true;
                    break;
                }
            };
        }