Why does WPF databinding swallow exceptions?

后端 未结 5 1351
迷失自我
迷失自我 2020-12-02 23:33

I recently wasted a lot of time trying to debug a WPF datagrid (from the WPF Toolkit). I had a column bound to a linq query with a property that was throwing an exception (i

5条回答
  •  温柔的废话
    2020-12-03 00:28

    Databinding errors are swallowed natively, but they are displayed in the OUTPUT dialog in the visual studio interface. If you wish to be notified (and have as much control over it as possible), then you can use Trace Sources.

    Bea Stollnitz provides a great writeup about this (and debuginng the bindings in general) here: http://www.beacosta.com/blog/?p=52

    Apparently, this blog has departed, but we do have the WayBack Machine: http://web.archive.org/web/20091103200557/http://www.beacosta.com/blog/?p=52

    I also added it to my Coding notebook for Evernote: https://www.evernote.com/pub/view/sswrighton/coding/f9786746-94c3-41b5-bcd2-c12992d331a6?locale=en#st=p&n=f9786746-94c3-41b5-bcd2-c12992d331a6

提交回复
热议问题