Skip to main content

DeviceWindows

Namespace: Wisej.Hybrid

Assembly: Wisej.Hybrid

Provides methods to interact with device windows.

public class DeviceWindows

Access this class through the Device singleton.

Constructors

Instance memberDeviceWindows()

Initializes a new instance of DeviceWindows.

Methods

Instance memberGetOpenWindows()

Gets an array of open window ids.

Returns: String[]. The ids.

Instance memberTryClose(id)

Tries to close a window with the given id.

ParameterTypeDescription
idStringThe window id.

Returns: Boolean. True if the window was successfully closed.

Instance memberTryOpen(url, title, location, size, minimumSize, maximumSize)

Tries to open a new window with the given URL.

ParameterTypeDescription
urlStringThe URL to open.
title optionalStringThe title of the window.
location optionalNullable<Point>The location of the window.
size optionalNullable<Size>The size of the window.
minimumSize optionalNullable<Size>The minimum size of the window.
maximumSize optionalNullable<Size>The maximum size of the window.

Returns: String. The ID of the new window or null if not created.

Instance memberTryPostMessage(id, data)

Tries to post a message to the given window id with the given payload.

ParameterTypeDescription
idStringThe window id.
dataStringThe data to post.

Returns: Boolean. True if the message was sent successfully.

Instance memberTrySetTitle(id, title)

Tries to set the title for the given window.

ParameterTypeDescription
idStringThe window id.
titleStringThe new title of the window.

Returns: Boolean. True if the action succeeded.

Events

Instance memberClosedWindow

EventHandler<String> Fires when a window is closed.

Instance memberNewWindow

EventHandler<String> Fires when a new window is created and shown.

Instance memberReceivedMessage

EventHandler<String> Fires when the current window receives a message from another window.