protected override void OnLostFocus(RoutedEventArgs e) { base.OnLostFocus(e); SelectionStart = 0; SelectionEnd = 0; _presenter?.HideCaret(); }
protected override void OnLostFocus(RoutedEventArgs e) { // Dispatch so that if there is a context menu, it can open before the selection gets cleared. Dispatcher.UIThread.PostLogException(() => { if (ContextMenu != null && ContextMenu.IsOpen) { _presenter?.HideCaret(); } else { base.OnLostFocus(e); } }); }