Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implement a click event for a stackpanel

I checked the stackpanel class here http://msdn.microsoft.com/en-us/library/system.windows.controls.stackpanel.aspx and it has no click event.

I'm working on a windows phone 8 app and I've got a textbox and some buttons on a stack panel. I want to include a feature where the stackpanel can be clicked then the visibility of the controls on it are set to collapsed, and then when clicked again they become visible.

How do I do this?

like image 379
Nii Laryea Avatar asked Jul 17 '13 11:07

Nii Laryea


3 Answers

Try using the MouseLeftButtonUp event.

like image 188
Daniel Hilgarth Avatar answered Sep 20 '22 00:09

Daniel Hilgarth


You could just wrap the whole stackpanel in a button:

<button>
    <stackpanel>
    </stackpanel>
</button>

Then attach a click event or command to the button as you see fit.

like image 41
Jon B Avatar answered Sep 24 '22 00:09

Jon B


put the StackPanel inside the Border control, use MouseLeftButtonUp of the Border to handle event and set background of the Border to #000001

like image 40
Tommy Avatar answered Sep 23 '22 00:09

Tommy