views:

17

answers:

2

I have a UserControl containing interactive elements within a grid. The user can move and resize these elements, often causing them to fall outside the bounds of my control. When elements do fall outside, I don't want them to clip. I want them to be visible no matter what. Unfortunately, setting ClipToBounds to FALSE did not solve the problem.

Even in the past during a similar situation, I had used ClipToBounds, and while it appeared to work at first, I noticed that out-of-bounds elements occasionally disappeared when dragged to certain locations. There didn't seem to be a logical explanation as to why they disappeared except that perhaps the layout system was out-prioritizing ClipToBounds being set to false, only at certain locations.

It was very annoying and my work-around involved programmatically resizing my UserControl constantly to encase all inner elements, which seems to be a very bad approach. Is there a cleaner way to ensure that my elements are always visible outside the bounds of my control (preferably without using ClipToBounds - is there a property I'm missing here)? Any help is greatly appreciated.

A: 

I think this might be due to virtualisation. Virtualisation means that everything which is not in the bounds of the layout panel will be not rendered, in order not to waste CPU.

Vitalij
+1  A: 

AFIK Canvas do not clip...

rudigrobler
Thanks. I changed Grid to Canvas and it started working.
Dalal