Search
WindowBase.windowClosing Event
See Also
 






Raised when the Window is closing.

Namespace: MindFusion.Common.UI
File: WindowBase.js

 Syntax

JavaScript  Copy Code

EventDispatcher windowClosing

 Event Data

The event handler method receives the following arguments:
sender
A WindowBase instance, which is the source of the event. This object will be passed to the handler function as the first argument.
args
A ControlModifyingEventArgs instance, which contains event data. This object will be passed to the handler function as the second argument.

 Remarks

The ControlModifyingEventArgs class exposes a cancel property that lets you stop the action.

 Example

The following code handles the windowClosing event of a Window class. The event handler checks the id of the Window and cancels the action and restores the window to normal size, if it is necessary.

JavaScript  Copy Code

var u = MindFusion.Common.UI;

window.windowClosing.addEventListener(windowClosingEventHandler);

function windowClosingEventHandler(sender, args)
{
  //if the window is registration
  if(sender.id === "registrationForms")
  {
      args.cancel = true;
      sender.restore();
  }
}

 See Also