I hate this answer, but it really depends on the context.
Today I can use IoC to get an ILoggerService or INotificationSerivce or both, and do something if something went wrong. Tomorrow I may be pleased with the unhandled MessageBox.Show () somewhere in the DispatcherUnhandledException event handler. Or maybe I'll write my own attached property ala
<Button loc:Commanding.ExceptionAwareCommand="{loc:CommandExtension Command={Binding TheClickCommand}, FallBackCammand={Binding ErrorHandlerCommand}}" />
and live with him ...
Perhaps the answer might look like this: "Choose the best way to communicate between the two classes and use it." Sorry for not being specific ... Maybe someone else will be more specific.
NB: The interface names provided in the response are not WPF standard. I use them as an example.
Greetings
Anvaka
source share