Question

I have a grid that has 4 Stackpanel child. I want to make visible other 3 stack panel with clicking first stackpanel and make collapsed with clicking other stackpanels. I am using Tap event in Stackpanel but it is not handled in empty parts of stackpanels.

How can I do it?

My StackPanel

Was it helpful?

Solution

Your StackPanels don't actually extend to the area you marked. You would need to change them into Grids with Auto-sized ColumnDefinitions for the text content and a star-sized column to the right or simply wrap your StackPanels in Grids. Also make sure the Backgrounds of your panels are not null (default) - use a brush, even if it is Transparent and make sure IsHitTestVisible isn't set to false - otherwise your panels will be invisible to hit testing and won't be interactive.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top