private void CodeEditor_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { if (!AvalonEditor.IsFocused) { AvalonEditor.Focus(); } }
private void FocusTabOnFile(CodeFile file, bool setFocus) { tabControl.FocusOn(file); if (setFocus) { Dispatcher.BeginInvoke(new Action(() => AvalonEditor.Focus())); // official hack! BAD! AvalonEditor.Focus(); } }
// ---------------------------------------------------------------------------------------- public void SetCaretTo(CodeFile file, int offset) { OpenTab(file, false); AvalonEditor.CaretOffset = offset; AvalonEditor.Focus(); ScrollTo(file, offset); SelectCurrentErrorForCaret(); }
public void ForceFocus() { Dispatcher.BeginInvoke(new Action(() => AvalonEditor.Focus())); // official hack! BAD! AvalonEditor.Focus(); }