0
votes

I need to create a non modal Silverlight 4.0 control that would appear (pop up?) when user enters specific TextBox on top of it to enable a richer way to edit its contents. This control has other controls and it has to hide when user clicks mouse elsewhere in SL application other than inside its borders. So I cannot use lostfocus event cause controls that are located in my usercontrol fire lostfocus when they are used.

I don't know which is the best solution for this, I've added canvas.MouseDown event where I check whether point is inside or outside my control, and this works OK but when user enters another control - like opens a combobox for example event is not fired and my control doesnt become invisible.

Id like to know which events - logic to use for this to work simplest and clearest.

I've been thinking about using popup, its unclear to me how exactly to use it for my scenario, and what exact functionality does it provide.

As I understand it will be shown on top of everything, which is good. However how can I hide popup if user clicks anywhere , but not on control hosted in popup?

My control doesn't have any "ok" button that could trigger hiding it. It has a slider that and a textbox that can be edited.

after some thought appears to be duplicate for : How to dismiss a popup in Silverlight when clicking outside of the control?

1

1 Answers

0
votes

You seem to be describing the function of the Silverlight Popup class.