Click here to Skip to main content
15,943,103 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

How do I add a user control into tooltip?

Currently, my silverlight project has a data grid table. Whenever user hovers to a specific cell in a given column, the tooltip will appear. The content of the tooltip would be the user control.

The user control in the tooltip should display summary info of the given cell hovered.

How to implement such feature (preferrably in MVVM)?

Thanks in advance!

-Melvin-
Posted

1 solution

When you define the ToolTip the content is an object which can be a UIElement.
http://msdn.microsoft.com/en-us/library/system.windows.controls.tooltip(v=vs.95).aspx[^]

Which means that you can just define your tooltip as such

XML
<tooltipservice.tooltip> 
   <tooltip>
      <local:myclass xmlns:local="#unknown" />
   </tooltip>
</tooltipservice.tooltip>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900