Class Window
- Namespace
- GroupeIsa.Neos.Designer.UIAbstractions.SystemEnvironment
- Assembly
- GroupeIsa.Neos.Designer.UIAbstractions.dll
Represents a window on the front end platform.
[ExcludeFromCodeCoverage]
[SuppressMessage("Minor Code Smell", "S2325:Methods and properties that don't access instance data should be static", Justification = "Transpilation abstraction.")]
public class Window
- Inheritance
-
Window
- Inherited Members
Properties
Current
Gets the current window.
public static Window Current { get; }
Property Value
DevicePixelRatio
Gets the device pixel ratio.
public static int DevicePixelRatio { get; }
Property Value
InnerHeight
Gets the current window inner height.
[SuppressMessage("Info Code Smell", "S1133:Deprecated code should be removed", Justification = "Obsolete")]
[Obsolete("Use InteriorHeight on window instance instead.")]
public static int InnerHeight { get; }
Property Value
InnerWidth
Gets the current window inner width.
[SuppressMessage("Info Code Smell", "S1133:Deprecated code should be removed", Justification = "Obsolete")]
[Obsolete("Use InteriorWidth on window instance instead.")]
public static int InnerWidth { get; }
Property Value
InteriorHeight
Gets the window inner height.
public int InteriorHeight { get; }
Property Value
InteriorWidth
Gets the window inner width.
public int InteriorWidth { get; }
Property Value
Location
Gets the window location.
public Location Location { get; }
Property Value
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
Parent
Gets the parent window (refer to the parent of the current window or subframe).
public static Window? Parent { get; }
Property Value
ScreenColorDepth
Gets the screen color depth.
public static int ScreenColorDepth { get; }
Property Value
ScreenHeight
Gets the screen height.
public static int ScreenHeight { get; }
Property Value
ScreenWidth
Gets the screen width.
public static int ScreenWidth { get; }
Property Value
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
namestringThe 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
namestringThe name of the iframe to find.
viewModelViewModel<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.
IsDarkTheme()
Gets a value indicating whether the current theme is dark.
public static bool IsDarkTheme()
Returns
- bool
trueif the theme is dark; otherwisefalse.
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
pathstringThe path to open.
targetstringA 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.
featuresstringA 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
urlstringThe url to open.
targetstringA 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.
featuresstringA 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
messageobjectData 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.
targetOriginstringSpecifies 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.
transfertobjectA 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
relativePathstringThe 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
pathstringThe 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.