Here’s an example image of what I mean: example
The gray rectangle is the bounding box of a control that draws the blue lines and dots in it’s OnRender(...) method. The red ovals mark places where it happens.
- Why is that possible?
- How can it be avoided?
https://msdn.microsoft.com/en-us/library/ms750441(v=vs.100).aspx has detailed information about the architectural design of WPF to answer why it is possible.
To avoid it you want to use the clip property of your element.
Check out http://msdn.microsoft.com/en-us/library/cc189065%28v=VS.95%29.aspx for more details.