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; } } }
private void LostFocus() { TextEditingTool tool = this.TextEditingTool; if (tool != null) { tool.AcceptText(TextEditingReason.LostFocus); } }