WPF - Closing Application

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?RGFsZSBXaWxsaWFtcw==?=

    WPF - Closing Application

    Everyone:

    When working with winform applications, you could check the reason for
    closing the window. As in this example:
    private void MainForm_FormCl osing(object sender,
    FormClosingEven tArgs e)
    {
    if (e.CloseReason == CloseReason.Use rClosing)
    {
    if (CloseApplicati on())
    Application.Exi t();

    else
    e.Cancel = true;

    }
    }

    Now, e doesn't return a closereason. Is there anyway to check why the
    window is closing?

    Thanks,
    Dale Williams
Working...