문제

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

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top