On Application.Close() instead of closing main window only it is better to close everything we can - there can be more than one window, e.g. in case of multi-threaded UI case.