I wrote a simple control that displays a popup with a ListBox. Implementer of my control can bind a command to SelectionChangedCommand, which will execute when user selects an item from the ListBox. However, before SelectionChangedCommand executes, I want to set IsDropDownOpen property on my control to false which will close the popup.
Basically I want to intercept SelectionChangedCommand, set IsDropDownOpen to false, then allow SelectionChangedCommand to execute normally. How do I do this?
StaysOpen property of Popup does not achive the desired effect and in fact prevents the popup from closing when the mouse leaves.
Example project attached.
Thank you
CommandProblem.zip
.
I wrote a simple control that displays a popup with a ListBox. Implementer of my control can bind a command to
SelectionChangedCommand, which will execute when user selects an item from the ListBox. However, beforeSelectionChangedCommandexecutes, I want to setIsDropDownOpenproperty on my control to false which will close the popup.Basically I want to intercept
SelectionChangedCommand, setIsDropDownOpento false, then allowSelectionChangedCommandto execute normally. How do I do this?StaysOpenproperty of Popup does not achive the desired effect and in fact prevents the popup from closing when the mouse leaves.Example project attached.
Thank you
CommandProblem.zip
.