I have a UserControl. Within this control I wish to draw ellipses. The problem I’m having is that I can’t seem to stop the ellipses from drawing outside of the UserControl. I was hoping by adding the ellipses to a grid, which is within a viewbox, that they wouldn’t draw outside it.
Below you will find a link to a screenshot, The light grey rectangle is the custom control. I don’t want the rings to appear outside. Can I crop the top and bottom somehow?

The lines are added as children of ‘GridlinesGrid’.

Any advice would be greatly appreciated.
Regards
Scott
Use the
ClipToBoundsproperty.Here’s the documentation for it:
http://msdn.microsoft.com/en-us/library/system.windows.uielement.cliptobounds.aspx