Activated also fires when the window is loaded for the first time.
Conceptually, the Activated event is the window equivalent of a
control??™s GotFocus event.
Deactivated Occurs when the user switches away from this window (for example, by
moving to another window in your application or another application).
Deactivated also fires when the window is closed by a user, after the
Closing event but before Closed. Conceptually, the Deactivated event is
the window equivalent of a control??™s LostFocus event.
Closing Occurs when the window is closed, either by a user action or
programmatically using the Window.Close() method or the
Application.Shutdown() method. The Closing event gives you the
opportunity to cancel the operation and keep the window open by
setting the CancelEventArgs.Cancel property to True. However, you
won??™t receive the Closing event if your application is ending because
the user is shutting down the computer or logging off. To deal with
these possibilities, you need to handle the Application.SessionEnding
event described in Chapter 3.
Closed Occurs after the window has been closed. However, the element objects
are still accessible, and the Unloaded event hasn??™t fired yet. At this
point, you can perform cleanup, write settings to a persistent storage
place (such as a configuration file or the Windows registry), and so on.
Pages:
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334