0

I am preparing to write a WPF client application that uses ICE (Internet Communication Engine) middleware. ICE requires proper initialization and finalization. All the examples show how to accomplish this in a usual console application - which is easy because you only need try-finally block and do some stuff in it.

What about WPF? How can I be sure that some code will be called no-matter-what happens to finalize the app?

kubal5003
  • 7,186
  • 8
  • 52
  • 90

1 Answers1

1

Have a look at the Application.Exit event

Also, see How to detect when application terminates?

Community
  • 1
  • 1
devdigital
  • 34,151
  • 9
  • 98
  • 120
  • Thank you. Application.Exit, as I've tested, is not called when an unhandled exception is thrown. The second link resolves that issue. – kubal5003 Jan 26 '11 at 00:50