Beispiel #1
0
        private void HandleKey(KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                TextBox box = this.TextBox;
                if (box != null && !box.AcceptsReturn)
                {
                    TextEditingTool tool = this.TextEditingTool;
                    if (tool != null)
                    {
                        tool.AcceptText(TextEditingReason.Enter);
                    }
                    return;
                }
            }
            else if (e.Key == Key.Tab)
            {
                TextBox box = this.TextBox;
                if (box != null



                    )
                {
                    TextEditingTool tool = this.TextEditingTool;
                    if (tool != null)
                    {
                        tool.AcceptText(TextEditingReason.Tab);
                    }
                    return;
                }
            }
        }
Beispiel #2
0
        private void LostFocus()
        {
            TextEditingTool tool = this.TextEditingTool;

            if (tool != null)
            {
                tool.AcceptText(TextEditingReason.LostFocus);
            }
        }