本文介绍了什么是绑定错误codeS的意思是,我在哪里可以找到他们的名单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在WPF得到一个绑定错误,有错误code与它去。

When I get a binding error in WPF, there is an error code that goes with it.

例如,

System.Windows.Data 错误:40 :BindingEx pression路径错误:
  产品属性而不是'对象'''产品型号'发现
  (哈希code = 57788087)。 BindingEx pression:路径=产品;
  的DataItem ='产品型号'(哈希code = 57788087);目标元素是
  文本框(名称='');目标属性是'文本'(类型'字符串')​​

System.Windows.Data 错误:4 :不能用于绑定找到源
  参考的RelativeSource FindAncestor,
  AncestorType ='System.Windows.Controls.ItemsControl',
  AncestorLevel ='1''。 BindingEx pression:路径= Horizo​​ntalContentAlignment;
  的DataItem = NULL;目标元素是'菜单项(名称='');目标属性
  是Horizo​​ntalContentAlignment'(类型'的Horizo​​ntalAlignment')

做什么这些错误codeS重新present,我在哪里可以找到它们的列表?

What do these error codes represent, and where can I find a list of them?

推荐答案

我不认为你会发现一个官方消息或文档的任何地方,这似乎是消息和codeS内部的 presentationFramework 组装。

I don't think you'll find an official source or documentation anywhere, these appear to be messages and codes internal to the PresentationFramework assembly.

这可能不是找出所有可能出错的一个地方,但如果你有一个工具,如.net反射或以其他方式源可用,你可以看一下 MS.Internal.TraceData 类,你会发现你的错误消息和codeS那里。

This may not be the single place to find all the possible errors but if you have a tool like .NET Reflector or otherwise have the source available, you could look at the MS.Internal.TraceData class and you'll find your error messages and codes there.

例如, TraceData.ClrReplaceItem()对应于错误 40 TRACEDATA。 nosource(与)对应于错误 4

For instance, TraceData.ClrReplaceItem() corresponds to error 40 and TraceData.NoSource() corresponds to error 4.

TRACEDATA 类会出现在<一个href=\"http://referencesource.microsoft.com/#$p$psentationFramework/Framework/MS/Internal/TraceData.cs,3e3eb7e4515cf94f\"相对=nofollow>基准源但它指出,生成的方法(那些我们感兴趣的)休息。列出的文件 AvTraceMessage.txt genTraceStrings.pl 似乎并没有被包括在内。所以,直到我们有机会获得这些文件,你必须检查装配。

The TraceData class does appear in the reference source however it notes that the rest of the methods (the ones we are interested in) are generated. The listed files AvTraceMessage.txt and genTraceStrings.pl don't appear to be included. So until we have access to those files, you'll have to inspect the assembly.

这篇关于什么是绑定错误codeS的意思是,我在哪里可以找到他们的名单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-03 14:05