工具提示中的用户控制 [英] User Control in tool tip

查看:78
本文介绍了工具提示中的用户控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如何在工具提示中添加用户控件?

当前,我的silverlight项目有一个数据网格表.只要用户将鼠标悬停在给定列中的特定单元格上,就会出现工具提示.工具提示的内容将是用户控件.

工具提示中的用户控件应显示已悬停的给定单元格的摘要信息.

如何实现这种功能(最好是在MVVM中)?

提前谢谢!

-Melvin-

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-

推荐答案

定义工具提示时,内容是可以是UIElement的对象.
http://msdn.microsoft.com/en -us/library/system.windows.controls.tooltip(v = vs.95).aspx [
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

<tooltipservice.tooltip> 
   <tooltip>
      <local:myclass xmlns:local="#unknown" />
   </tooltip>
</tooltipservice.tooltip>


这篇关于工具提示中的用户控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆