Does BindingExpression (path) error affect the performance?

China☆狼群 提交于 2019-12-30 23:22:43

问题


We have some derived control classes which have specific data. And these controls also set the data error info and binding to some specific property. For example, if the property IsNew (providing it exists) is true then the background is highlighted.

Now I want to know, what if I use these controls and bind to some objects which do not expose such property as IsNew? Will it affect the performance for Release version?


回答1:


The error in itself will not cause any additional performance issues, but the constant Binding checks will and do cause some very minor (practically unnoticeable) performance issues. This is one of the many reasons why WPF performs less well than many other languages. However, these checks will go on whether you have errors or not.

The only time that having errors will actually slow down your program is when your are using the PresentationTraceSources to output information into the Output Window of Visual Studio or worse still, into an external trace file. However, even in these cases, it is unlikely that you will find a noticeable drop in performance, unless you have set the WPF Trace Settings to the most verbose setting of Verbose.



来源:https://stackoverflow.com/questions/23541265/does-bindingexpression-path-error-affect-the-performance

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!