Home > DeveloperSection > Forums > How to find out how a popup was closed
Hank Greenberg
Hank Greenberg

Total Post:12

Points:84
Posted on    August-09-2013 7:24 AM

 WPF WPF 
Ratings:


 1 Reply(s)
 750  View(s)
Rate this:
Hi developers!

I have created a textbox with a button in it so it looks like a combobox. For the dropdown menu I use a popup. I did this because I have a treeview inside the dropdown menu and a small summary of what is selected in the treeview as the SelectedItem.

Here is my problem: When I click the button when the popup is open it closes the popup first and then due to the button's click event the popup opens up again and I want to prevent this behavior.

My idea for the solution is to have a bool variable which is set true when the popup is closed because one clicked the button and the button click event only opens the popup when the variable is false. But this only applies when you know exactly you didn't click anywhere else.

Has somebody a solution for this problem?

Thank in advance



Pravesh Singh

Total Post:411

Points:2881
Posted on    August-10-2013 5:32 AM

You can solve this problem by setting the button's IsEnabled to false when the popup is opened and setting it back to true when the popup's Closed-Event is called.


Don't want to miss updates? Please click the below button!

Follow MindStick