WindowResultContext<T>
Namespace: Hex1b
Assembly: Hex1b.dll
Provides context for window result callbacks when a dialog closes with a typed result.
public sealed class WindowResultContext<T>Inheritance
Object → WindowResultContext<T>
Properties
IsCancelled
Whether the dialog was cancelled (closed without providing a result). When true, should not be used.
Returns: Boolean
public bool IsCancelled { get; }Value
The result value provided via . This is the default value of T when is true.
Returns: <T>
public T? Value { get; }Window
The window entry that was closed.
Returns: WindowEntry
public WindowEntry Window { get; }Windows
Convenience accessor for the window manager. Use this to open additional windows or perform other window operations.
Returns: WindowManager
public WindowManager Windows { get; }Remarks
WindowResultContext is passed to OnResult callbacks when a window closes, providing access to the result value and cancellation state.
A result is considered cancelled when the window is closed without calling
- for example, via the close button or Escape key.
Examples
e.Windows.Window(w => w.VStack(v => [
v.Text("Delete this item?"),
v.HStack(h => [
h.Button("Yes").OnClick(_ => w.Window.CloseWithResult(true)),
h.Button("No").OnClick(_ => w.Window.CloseWithResult(false))
])
]))
.Title("Confirm Delete")
.Modal()
.OnResult(result => {
if (!result.IsCancelled && result.Value)
{
DeleteItem();
}
})
.Open(e.Windows);