Silverlight调试,无列表元素视图
当我调试 Silverlight 应用程序并且在内部使用列表时,我无法将鼠标悬停在列表上并查看列表中的项目。我只看到列表的原始视图。
如果我想查看这些项目,我必须编写自己的代码,这很乏味。这对于 Silverlight 来说是正常现象吗?
在正常控制台/WPF/...应用程序中调试时,我确实有正确的列表视图。
示例:Silverlight(e.Result
是一个 Dictionary
): (链接:点击)
看看怎么没有'列表视图'第一个例子?
在这个中,非 Silverlight:(链接:点击)
该系统是Windows 7 64位,带有Visual Studio 2010和Silverlight 4 SDK RC2。
When I'm debugging my Silverlight Appliction and I'm using a list internally I cannot hover over the list and see the items inside the list. I just see the RAW view of the list.
If I want to see the items I have to write my own code which is tedious. Is this something normal to Silverlight?
I DO have the correct list view when debugging in normal Console/WPF/... applications.
Example: Silverlight (e.Result
is a Dictionary<DateTime, decimal>
):
(link: click)
See how there is no 'list view in the first example?
And there in this one, non Silverlight:(link: click)
The system is a Windows 7 64-bit, with Visual Studio 2010 and the Silverlight 4 SDK RC2.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
有一种解决方法可以将字典的内容转储到调试器中。
在您的项目中,添加对 linq dll 的引用(例如 System.Core)
将以下语句添加到您的 项目中源文件:
using System.Linq;
在监视窗口中,键入:
dic.Take(21)
然后展开“结果视图”组行。这将为您提供熟悉的键值对列表。
[rickpastoor 在 connect.microsoft.com 上报告了 Bug 557741 的解决方法]
There is a workaround to dump the contents of the dictionary in the debugger.
To your project, add a reference to the linq dll (e.g. System.Core)
Add the following statement to your source file:
using System.Linq;
In the watch window, type:
dic.Take(21)
Then expand the "Results View" group row. This should give you the familiar list of key, value pairs.
[This workaround was reported by rickpastoor on connect.microsoft.com for Bug 557741]
Silverlight 的词典>>类具有 [DebuggerTypeProxy] 属性,但它在当前版本的工具集中不起作用。 这个中也提到了线程。同样的建议,请在 connect.microsoft.com 上报告该错误,以便他们了解该错误,希望该错误能够在该工具的官方 RTM 版本中得到修复。
Silverlight's Dictionary<> class has a [DebuggerTypeProxy] attribute but it doesn't work in the current release of the toolset. Also mentioned in this thread. Same advice, report the bug at connect.microsoft.com so they are aware of it, hopefully it will be fixed in the official RTM release of the tools.
我尝试将字典从 WCF 发送到 Silverlight,我可以在调试器中看到数据。所以它也应该适合你。也许你的代码有什么问题?
您到底使用什么“日期”类?请像我一样尝试使用 DateTime 。
这是我的服务器端代码:
I tried to send Dictionary from WCF to Silverlight and I can see the data in the debugger. So it should work fine for you too. Maybe there's something about your code?
What exactly "Date" class are you using? Please try DateTime instead as I did.
Heres' my server side code: