/// <summary>
 /// Shows popup, filters assist list based on the last word. Place popup just at the current CaretPosition within RichTextBox
 /// </summary>
 /// <param name="lastWord"></param>
 private void ShowPopup(string lastWord)
 {
     m_assistListPopup.DataContext        = ContentAssistTriggers.FindAll(item => item.StartsWith(lastWord, StringComparison.CurrentCultureIgnoreCase));
     m_assistListPopup.PlacementTarget    = this;
     m_assistListPopup.PlacementRectangle = CaretPosition.GetCharacterRect(LogicalDirection.Forward);
     m_assistListPopup.IsOpen             = true;
 }
Beispiel #2
0
        void MoveUpByLineExecuted(object target, ExecutedRoutedEventArgs e)
        {
            TextPointer tp = CaretPosition;
            Rect        r  = CaretPosition.GetCharacterRect(LogicalDirection.Forward);

            CommandBindings.Remove(cbup);
            EditingCommands.MoveUpByLine.Execute(null, this);
            CommandBindings.Add(cbup);
            if (tp.CompareTo(CaretPosition) == 0)
            {
                MoveToLiveEventArgs l = new MoveToLiveEventArgs(MyEdit.MoveToPrevLine, r);
                RaiseEvent(l);
            }
        }