I used to write thick c# client code that would throw exceptions down in the engine room (network failure say) and expect somebody above me to deal with it. Eventually bubbling up to an appwide try/catch that would handle the leftovers ("Unexpected exception in foo bar, click for details, contact support...."), plus maybe a appdomain wide unhandled exception handler just in case.

Now I am writing a 'thick' client in Silverlight and I don't know what to do anymore. Large amounts of my engine room code run as network event driven callbacks, and I then invoke a lambda supplied to me by the original caller; but they are long gone. I cant throw an exception at them, there is no stack to bubble up. I can't force them to unwind. They are still in a pending state (whatever that might mean for that particular async invoke).

I see AsyncEventCompletedArgs with its RaiseExceptionIfNeeded trick. Using this seems to expose my low level plumbing to the higher level code (think MVVM , MVC, ...). I want to help the upper level code 'do the right thing' by default, like they did in the good old sync/exception driven days. But this doesnt help. They read the result from the AsyncArgs instance, that throws and the call back dies, leaving them still logically dangling

Anyway - hope this makes sense. Does anybody have any designs, experience that they want to share. What do any of the SL MVVM, MVC frameworks do?

Note - I am not talking about the fancy new Async stuff in c#5 (would that help at all?)

(Probably going to get closed as not specific enough, too subjective, etc, sigh)