Suppose you have a ToggleButton for opening a Popup, same behaviour as all known elements as ComboBox etc.
ToggleButton
Popup
ComboBox
... which is this c
To prevent closing the Popup by clicking its background, insert something that will fill it.
In this example, clicking the unfilled space will close the Popup:
In this example, clicking the unfilled space will NOT close the Popup: