I don't have an explanation for the beta 2 behavior.
With the latest bits, you should be able to do something like this. This is off the cuff code, no guarantee it's bug free .
void OnMouseMoveListener(object sender, MouseEventArgs e)
{
TextPointer position = richTextBox.GetPositionFromPoint(e.GetPosition(richTextBox), false /* snapToText */);
if (position == null)
{
return;
}
UIElement uiElement = position.GetAdjacentElement(position.LogicalDirection) as UIElement;
if (uiElement != null && IsInterestingElement(uiElement))
{
DoSomething();
}
}
The basic idea is that position will be adjacent to whatever the mouse is over. Its LogicalDirection property tells you if the content hit precedes or follows the pointer.
Ben
|