Пример #1
0
 public void DrawRectangleAtCaret()
 {
     if (MainTextBox != null && showLineThing.IsChecked == true)
     {
         Rect      p = MainTextBox.GetCaretLocation();
         Thickness t = new Thickness(0, p.Y - 1, 17, MainTextBox.ActualHeight - p.Bottom - 1);;
         if (t.Top >= 0 && t.Bottom >= 0)
         {
             aditionalSelection.Visibility = Visibility.Visible;
             aditionalSelection.Margin     = t;
         }
         else
         {
             aditionalSelection.Visibility = Visibility.Collapsed;
         }
     }
     else
     {
         aditionalSelection.Visibility = Visibility.Collapsed;
     }
 }