How can I use the tap event in an empty stackpanel folder?

I have a grid with 4 Stackpanel children. I want to make the other 3 panels of the stack visible by clicking the first stack panel and crashing it by clicking the other stack panels. I use the Tap event in the Stackpanel, but it is not handled in the empty parts of the stack panels.

How can i do this?

My stackpanel

+4
source share
1 answer

Your StackPanels do not actually extend to the marked area. You will need to swap them for grids using Auto-size ColumnDefinitions for text content and a star-size column on the right or just wrap your StackPanels in grids. Also make sure that the backgrounds of your panels are not zero (by default) - use a brush even if it is transparent, and make sure that IsHitTestVisible is not set to false - otherwise your panels will be invisible for testing and will not be interactive.

+3
source

Source: https://habr.com/ru/post/1489220/


All Articles