I created Google as a SearchBox control in Silverlight. This means that when I enter into the field, the DropDownListBox appears just below the SearchBox, showing all the elements that match the text that I typed in the search bar so far (for example, the autocomplete function), exactly the same:

Now I want to add functionality to it: I want DropDownListBox to disappear as soon as the user clicks on it or anywhere on the screen. I cannot process MouseLeftButtonDown(or any such event) in other controls to accomplish this, because users can click anywhere, including in the non-Silverlight region. Can someone suggest me what I have to do to achieve this?
So my question is basically this:
How do I know if a user has just been clicked and the click event occurred outside of a specific control?
Please note that AutoCompleteBoxdoes not serve my purpose. Therefore, I cannot use it.
Nawaz source
share