Documentation Index
Fetch the complete documentation index at: https://mintlify.com/DevToys-app/DevToys/llms.txt
Use this file to discover all available pages before exploring further.
UIToolView is the root container that every IGuiTool implementation returns from its View property. It wraps a single IUIElement root (typically a layout component such as IUIStack or IUIGrid), controls whether the tool’s content is scrollable, and manages the lifecycle of modal dialogs. The DevToys rendering engine mounts the UIToolView directly into the tool panel when the user navigates to a tool.
Namespace: DevToys.ApiInheritance: Implements
INotifyPropertyChanged
Constructors
isScrollable defaults to true when not specified. All overloads delegate to the full constructor UIToolView(bool isScrollable, IUIElement? rootElement).
Properties
When
true (the default), DevToys wraps the tool’s content in a scroll viewer, allowing the tool to exceed the visible area. Set to false for tools whose layouts should always fit exactly within the available space — for example, a split-pane editor where each pane manages its own scrolling.The top-level UI element rendered inside the tool panel. Typically a layout container such as
GUI.Stack(...), GUI.SplitGrid(...), or GUI.Grid(...). May be null while the view is being constructed; the rendering engine re-renders whenever this property changes.The modal dialog currently displayed over the tool, or
null when no dialog is open. Only one dialog can be open at a time. This property is set and cleared automatically by OpenDialogAsync and the dialog’s Close() method respectively.Events
| Event | Description |
|---|---|
IsScrollableChanged | Raised when IsScrollable changes. |
RootElementChanged | Raised when RootElement changes. |
CurrentOpenedDialogChanged | Raised when CurrentOpenedDialog changes (dialog opened or closed). |
PropertyChanged | Standard INotifyPropertyChanged event raised for any property change. |
Methods
OpenDialogAsync (two overloads)
UIDialog instance so the caller can programmatically close it or await UIDialog.DialogCloseAwaiter.
The UI element to display as the body of the dialog.
An optional element rendered in the dialog footer — typically a row of buttons.
When
true, the user can close the dialog by clicking outside it, pressing Escape, or moving focus away. When false, the dialog can only be closed programmatically via UIDialog.Close().Calling
OpenDialogAsync while a dialog is already open throws an InvalidOperationException. Always ensure CurrentOpenedDialog is null before opening a new dialog.GetChildElementById
RootElement for the first element whose Id matches the given string. Returns null if no element is found or if RootElement does not implement IUIElementWithChildren.
This method traverses the full UI tree and may be slow for complex layouts. Prefer storing direct references to elements as fields in the tool class rather than relying on this lookup in hot paths.
Extension Method
UIToolView with a root element:
UIDialog
UIDialog is returned by OpenDialogAsync. It is not constructed directly.
UIDialog Members
| Member | Type | Description |
|---|---|---|
IsOpened | bool | true while the dialog is visible. |
IsDismissible | bool | Whether clicking outside or pressing Escape closes it. |
DialogContent | IUIElement? | The body element passed to OpenDialogAsync. |
FooterContent | IUIElement? | The footer element, if any. |
DialogCloseAwaiter | Task | A task that completes when the dialog is closed. |
IsOpenedChanged | event EventHandler? | Raised when IsOpened changes. |
Close() | method | Programmatically closes the dialog. |
Dispose() | method | Calls Close() — safe to use in using blocks. |