Class PopoutHelper
Pops any UserControl out into a standalone window. Only available on Desktop (Windows/macOS/Linux).
Usage from a ViewModel command or code-behind:
PopoutHelper.TryPopout(myVisualizationPanel, "EMG Monitor", 800, 500);
The control is removed from its current parent, placed in the new window, and returned to its original parent when the window closes.
Inherited Members
Namespace: MOSAIC.Services
Assembly: MOSAIC.dll
Syntax
public static class PopoutHelper
Properties
IsDesktop
Returns true only when the running Avalonia host supports desktop windows. Single-view mobile/browser hosts must never construct a Window, even when shared code was compiled on a desktop OS.
Declaration
public static bool IsDesktop { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
SupportsDesktopWindows(IApplicationLifetime?, bool)
Declaration
internal static bool SupportsDesktopWindows(IApplicationLifetime? lifetime, bool mobileLayout = false)
Parameters
| Type | Name | Description |
|---|---|---|
| IApplicationLifetime | lifetime | |
| bool | mobileLayout |
Returns
| Type | Description |
|---|---|
| bool |
TryPopout(Control, string, int, int)
Detaches control from its current parent and opens it
in a new window. When the window closes, the control is re-attached to
its original parent.
Declaration
public static bool TryPopout(Control control, string title = "MOSAIC", int width = 900, int height = 600)
Parameters
| Type | Name | Description |
|---|---|---|
| Control | control | The control to pop out. |
| string | title | Window title. |
| int | width | Initial window width. |
| int | height | Initial window height. |
Returns
| Type | Description |
|---|---|
| bool | True if the window was opened, false if not on desktop or control has no parent. |
TryPopoutCopy<T>(object?, string, int, int)
Clones the DataContext and opens a fresh instance of
T in a new window. The original control
stays in place — useful when you don't want to detach it.
Declaration
public static bool TryPopoutCopy<T>(object? dataContext, string title = "MOSAIC", int width = 900, int height = 600) where T : Control, new()
Parameters
| Type | Name | Description |
|---|---|---|
| object | dataContext | |
| string | title | |
| int | width | |
| int | height |
Returns
| Type | Description |
|---|---|
| bool |
Type Parameters
| Name | Description |
|---|---|
| T |