views:

115

answers:

0

I have searched around but have been unable to find out the recommended pattern for generic exception handling when using a control such as the wpf toolkit datagrid.

As an example, at the moment I am getting unhandled exceptions caught by my shell application. This happens when a user clicks on a column header to sort it, and it is unable to sort thanks to some data that got loaded at run-time. Obviously this is a bug that I intend to fix, but I would rather catch all exceptions that the grid can throw and deal with them within my page.

I am using the composite application library and the mvvm pattern. All unhandled exceptions are caught by my CAL shell so this is a good fall-back position, but I would like unhandled exceptions on my pages in my modules to catch unhandled exceptions that relate to them. I have separate exception handlers in each module and I would rather this handler was the one that dealt with an exception from the grid rather than it reaching the shell application.

Any thoughts?