The WindowHost control represents a container of windows. The Window control derives from WindowBase and represents a window with header, content and status bar. Windows within the WindowHost can be free-floating, minimized, maximized or pinned in position.
![]() |
---|
More information about the Window control can be found in the Window topic. |
Use the Windows property to get a reference to the control's collection of Window instances.
Minimizing, maximizing, pinning, opening and closing of a window within the WindowHost is defined by the following set of properties: WindowState and Visibility. The EnabledInteractions property specifies what type of interactions that can be applied to a Window.
ASPX
![]() |
---|
<%-- Window1 is in the default state - all interactions are enabled, it is visible and in normal state. --%> |
The WindowHost tracks the zIndex of the child windows, ensuring that the active window is always topmost. The base index from which all windows will be offset by is determined by the value of the BaseZIndex property.
Use WindowHost.Windows.Add method to add a new window to the collection.
C#
![]() |
---|
Window window = new Window(); |
VB.NET
![]() |
---|
Dim window As New Window() |
Use WindowHost.Windows.Remove or WindowHost.Windows.RemoveAt to remove a specified window from the collection.
C#
![]() |
---|
WindowHost1.Windows.RemoveAt(WindowHost1.Windows.Count - 1); |
VB.NET
![]() |
---|
WindowHost1.Windows.RemoveAt(WindowHost1.Windows.Count - 1) |
The following events are exposed by the WindowHost control.
Event | Event arguments | Description |
---|---|---|
Raised when a Window is created. | ||
Raised when a Window is deleted. |
You can access the control on the client side by its ClientID.
JavaScript
![]() |
---|
var windowHost = $find("WindowHost1"); |
Use the getAllWindows method to get a reference to the control's windows array. Use the getActiveWindow method to access the currently active window. To get references to all closed windows use the getClosedWindows function.
Use the minimizeAll, restoreAll, closeAll and showAll methods to respectively minimize, restore, close or show all child windows.
Use the WindowHost.createWindow method to add a new window to its windows array. The createWindow method accepts as parameter a JSON object, containing the data for the new item. Use the data object to define values for the properties and events, exposed by the Window class.
JavaScript
![]() |
---|
windowHost.createWindow({ |
Use the WindowHost.deleteWindow method to remove a specified window from the array.
JavaScript
![]() |
---|
windowHost.deleteWindow(windowHost.getAllWindows()[0]); |
The following client-side events are exposed by the WindowHost class.
Event | Event arguments | Script property | Description |
---|---|---|---|
- | Raised just after the control has finished loading and is ready for interaction. | ||
Raised when the active window in the control is changed. |