'WPF line hittest tolerance

I have a canvas where i draw a Line during mouse move. After I have the line, I want to show an overlay when the mouse is over/near the line. I know that I can use the MouseEnter and MouseLeave events from the Line object, but this is really hard when the Line object was created with a StrokeThickness of 1px. So how can I increase the MouseEnter or MouseLeave area to show my overlay even if the mouse pointer is not exactly on the line itself (some defined area around)?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source