Table of Contents

Class Window

Namespace
GroupeIsa.Neos.Designer.UIAbstractions.SystemEnvironment
Assembly
GroupeIsa.Neos.Designer.UIAbstractions.dll

Represents a window on the front end platform.

public class Window
Inheritance
Window
Inherited Members

Properties

Current

Gets the current window.

public static Window Current { get; }

Property Value

Window

DevicePixelRatio

Gets the device pixel ratio.

public static int DevicePixelRatio { get; }

Property Value

int

InnerHeight

Gets the current window inner height.

[Obsolete("Use InteriorHeight on window instance instead.")]
public static int InnerHeight { get; }

Property Value

int

InnerWidth

Gets the current window inner width.

[Obsolete("Use InteriorWidth on window instance instead.")]
public static int InnerWidth { get; }

Property Value

int

InteriorHeight

Gets the window inner height.

public int InteriorHeight { get; }

Property Value

int

InteriorWidth

Gets the window inner width.

public int InteriorWidth { get; }

Property Value

int

Location

Gets the window location.

public Location Location { get; }

Property Value

Location

Opener

Gets a reference to the window that opened the window, either with open() or by navigating a link with a target attribute.

public Window? Opener { get; }

Property Value

Window

Parent

Gets the parent window (refer to the parent of the current window or subframe).

public static Window? Parent { get; }

Property Value

Window

ScreenColorDepth

Gets the screen color depth.

public static int ScreenColorDepth { get; }

Property Value

int

ScreenHeight

Gets the screen height.

public static int ScreenHeight { get; }

Property Value

int

ScreenWidth

Gets the screen width.

public static int ScreenWidth { get; }

Property Value

int

Methods

Close()

Closes the current window, or the window on which it was called.

public void Close()

Remarks

This method can only be called on windows that were opened by a script using the Window.open() method, or on top-level windows that have a single history entry.

FindIframe(string)

Finds a iframe by name in web page.

public Window? FindIframe(string name)

Parameters

name string

The name of the iframe to find.

Returns

Window

The window instance representing the iframe, or null if not found.

Remarks

web-view component is translated to iframe, this method can be used to search for a web view by name.

FindIframe(string, ViewModel<IUIView>)

Finds a iframe by name in a specified ui view.

public Window? FindIframe(string name, ViewModel<IUIView> viewModel)

Parameters

name string

The name of the iframe to find.

viewModel ViewModel<IUIView>

The view model of the ui view to find the iframe in.

Returns

Window

The window instance representing the iframe, or null if not found.

Remarks

web-view component is translated to iframe, this method can be used to search for a web view by name.

GetQueryParameters()

Gets the query parameters of the current location.

public static IDictionary<string, string> GetQueryParameters()

Returns

IDictionary<string, string>

A dictionnary of parameters.

OpenPath(string, string?, string?)

Opens to the specified path in a new page.

public static Window? OpenPath(string path, string? target = null, string? features = null)

Parameters

path string

The path to open.

target string

A string, without whitespace, specifying the name of the browsing context the page is being loaded into. If the name doesn't identify an existing context, a new context is created and given the specified name.

features string

A string containing a comma-separated list of window features in the form "name=value" or for boolean features, just "name". These features are listed here : https://developer.mozilla.org/en-US/docs/Web/API/Window/open#windowfeatures.

Returns

Window

The window instance if the browser successfully opens the new page. The returned reference can be used to access properties and methods of the new context as long as it complies with the same-origin policy security requirements. null is returned if the browser fails to open the new page, for example because it was blocked by a browser popup blocker.

Remarks

The path should be relative to the base url.

OpenUrl(string, string?, string?)

Opens to the specified url in a new page.

public static Window? OpenUrl(string url, string? target = null, string? features = null)

Parameters

url string

The url to open.

target string

A string, without whitespace, specifying the name of the browsing context the page is being loaded into. If the name doesn't identify an existing context, a new context is created and given the specified name.

features string

A string containing a comma-separated list of window features in the form "name=value" or for boolean features, just "name". These features are listed here : https://developer.mozilla.org/en-US/docs/Web/API/Window/open#windowfeatures.

Returns

Window

The window instance if the browser successfully opens the new page. The returned reference can be used to access properties and methods of the new context as long as it complies with the same-origin policy security requirements. null is returned if the browser fails to open the new page, for example because it was blocked by a browser popup blocker.

PostMessage(object, string?, object?)

Posts a message to safely enable cross-origin communication between Window objects.

public void PostMessage(object message, string? targetOrigin = null, object? transfert = null)

Parameters

message object

Data to be sent to the other window. The data is serialized using the structured clone algorithm. This means you can pass a broad variety of data objects safely to the destination window without having to serialize them yourself.

targetOrigin string

Specifies what the origin of this window must be for the event to be dispatched, either as the literal string "*" (indicating no preference) or as a URI.

transfert object

A sequence of transferable objects that are transferred with the message.

Print()

Opens the print dialog to print the current document.

public void Print()

RelativeToAbsoluteUrl(string)

Gets the absolute url from a relative url.

public static string RelativeToAbsoluteUrl(string relativePath)

Parameters

relativePath string

The relative path.

Returns

string

The absolute url.

Reload()

Reloads the page.

public static void Reload()

ReplaceCurrentPagePath(string)

Replaces the path of the current page.

public static void ReplaceCurrentPagePath(string path)

Parameters

path string

The new path.

Remarks

The path should be relative to the base url.

The current page will not be saved in session history, so the user won't be able to use the back button to navigate to it.