meds
meds

Reputation: 22956

Silverlight - dynamically displaying a popup box on hover?

I have a silverlight control, for arguments sake let's say it inherits from the Button control. how can I make it so that if the mouse hovers over it a popup box (with media such as text and pictures in it) appears at the mouses (or controls) position? The box itself doesn't take access away from the window or anything, it just appears when the mouse hovers over the button.

Thanks for any help!

Upvotes: 1

Views: 1746

Answers (1)

Justin XL
Justin XL

Reputation: 39006

what you can do is, you can put a PopUp control inside your control's style. And because your control inherits from a Button, it should have a MouseOver state. Then when it is in MouseOver state, you just set the IsOpen of the PopUp to true.

If you want the content of the PopUp to be bindable (dynamic) you can define a dependency property in your control and have a ContentControl under your PopUp TemplateBinding to it inside your style.

Upvotes: 2

Related Questions