Class CloseWatcher
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
NOTE
ExperimentalCloseWatcher interface allows a custom UI component with open and close semantics to respond to device-specific close actions in the same way as a built-in component.
[Value("CloseWatcher")]
public class CloseWatcher : EventTarget
- Inheritance
-
CloseWatcher
- Inherited Members
Remarks
The CloseWatcher interface inherits from EventTarget.
-Close(string) event on HTMLDialogElement
Constructors
CloseWatcher()
public CloseWatcher()
CloseWatcher(CloseWatcherOptions)
public CloseWatcher(CloseWatcherOptions options = null)
Parameters
optionsCloseWatcherOptions
Remarks
You can create CloseWatcher instances without user activation, and this can be useful to implement cases like session inactivity timeout dialogs. However, if you create more than one CloseWatcher without user activation, then the newly-created one will be grouped together with the last one, so a single close request will close them both. This means that it is important to call Destroy(), Close(), and RequestClose() properly.
Properties
Oncancel
[Value("oncancel")]
public EventHandlerNonNull Oncancel { get; set; }
Property Value
Onclose
[Value("onclose")]
public EventHandlerNonNull Onclose { get; set; }
Property Value
Methods
Close()
NOTE
Experimentalclose() method of the CloseWatcher interface lets you skip any logic in the cancel event handler and immediately fire the close event. It then deactivates the close watcher as if destroy() was called.
[Value("close")]
public GlobalObject.Undefined Close()
Returns
Remarks
Destroy()
NOTE
Experimentaldestroy() method of the CloseWatcher interface deactivates the close watcher. This is intended to be called if the relevant UI element is torn down in some other way than being closed.
[Value("destroy")]
public GlobalObject.Undefined Destroy()
Returns
Remarks
After being deactivated, this CloseWatcher will no longer receive cancel or close events, and it will be possible to create new independent CloseWatcher instances.
RequestClose()
NOTE
ExperimentalrequestClose() method of the CloseWatcher interface fires a cancel event and if that event is not canceled with PreventDefault(), proceeds to fire a close event, and then finally deactivates the close watcher as if destroy() was called.
[Value("requestClose")]
public GlobalObject.Undefined RequestClose()