Why does WPF databinding swallow exceptions?

后端 未结 5 1350
迷失自我
迷失自我 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:15

    I implemented a solution very similar to the one proposed by Karsten:

    1. Derived a TraceListener that throws instead of logging
    2. Added that listener to PresentationTraceSources.DataBindingSource

    Please see the complete solution on GitHub, it includes a demo application and a unit test project.

    Exception in Visual Studio

提交回复
热议问题