Silverlight 持续时间工具提示
我正在尝试增加工具提示在 silverlight 应用程序中显示的时间长度。我从 codeplex 下载了 Silverlight.Controls.ToolTip 并将其添加为参考。这是我的 xaml 中的代码:
xmlns:Controls="clr-namespace:Silverlight.Controls.ToolTips;assembly=Silverlight.Controls.ToolTips"
<Button Content="button content">
<Controls:ToolTipService.ToolTip>
<Controls:ToolTip DisplayTime="00:00:10" InitialDelay="00:00:03">
<TextBlock Text="tooltip"></TextBlock>
</Controls:ToolTip>
</Controls:ToolTipService.ToolTip>
</Button>
代码编译。但是,在运行代码时,我收到错误“发生 XamlParseException 在“ToolTipService”中找不到可附加属性“ToolTip”。关于导致此错误的任何想法吗?
I'm trying to increase the length of time that a tooltip displays in a silverlight application. I downloaded Silverlight.Controls.ToolTip from codeplex and I add it as a reference. Here is my code in my xaml:
xmlns:Controls="clr-namespace:Silverlight.Controls.ToolTips;assembly=Silverlight.Controls.ToolTips"
<Button Content="button content">
<Controls:ToolTipService.ToolTip>
<Controls:ToolTip DisplayTime="00:00:10" InitialDelay="00:00:03">
<TextBlock Text="tooltip"></TextBlock>
</Controls:ToolTip>
</Controls:ToolTipService.ToolTip>
</Button>
The code compiles. However, while running the code I get an error "XamlParseException occurred The attachable property 'ToolTip' was not found in 'ToolTipService.' Any ideas on what is causing this error? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我遇到了同样的问题,这是我解决的方法。
1) 转到:http://tooltipservice.codeplex.com/SourceControl/BrowseLatest
2) 下载源代码
3) 复制“ToolTip.cs”、“ToolTipService.cs”和 ToolTipTimer.cs
“branches\2.2.0\Silverlight.Controls.ToolTips\”到您自己的项目中的某个位置。
4) 现在将 xmlns 指向您已将源文件复制到的项目中的程序集。
所以基本上,只要使用源文件而不是 dll 就可以了。这对我有用,希望对你有用。
祝你好运。
I had the same problem, here is how I solved it.
1) Go to: http://tooltipservice.codeplex.com/SourceControl/BrowseLatest
2) Download the Source Code
3) Copy "ToolTip.cs", "ToolTipService.cs" and ToolTipTimer.cs from
"branches\2.2.0\Silverlight.Controls.ToolTips\" into your own project somewhere.
4) Now point the xmlns to assembly on your own project where you have copied the source file into.
So basically, just use the source file instead of the dll and it will work. This has worked for me, hope it works for you.
Good Luck.
如果您从另一个 DLL 引用 ToolTip DLL,请尝试将对其的引用添加到您的主项目中。
If you are referencing the ToolTip DLL from another DLL, try also adding a reference to it into you main project.
您已从网络下载了此 DLL,但尚未解锁。
右键单击 DLL,转到属性并取消阻止它。
You have downloaded this DLL from web and have not unblocked it yet.
Right Click on the DLL, go to properties and unblock it.