Search code examples
wpfwrappanel

Unwanted clipping in WrapPanel


I need to create a ListBox with the WrapPanel ItemsTemplate.

My item is displayed as a card with small top "toolbar" that is displaying dynamically on mouse over.

[ dyn. toolbar ] [ card ]

Everything is running well except the first line.

I need to have cards very close each other. Hence the Height of the item is set to height of the card without toolbar height. Toolbar is created with Margin.Top < 0.

The problem is that toolbar is clipped by the listbox.

Do you know any techniques on how to solve this situation?

Thanks to all!


Solution

  • I'm not sure I fully understand your question, but if you're displaying the toolbar above the card using a negative top margin, couldn't you compensate for this by dynamically setting a positive margin on the card whenever the toolbar is shown?