Dialog
Description
The Dialog component is a modal overlay that is used to display temporary content and gather user confirmation or input. It blocks interaction with the underlying application until it is dismissed. This component is ideal for quick, actionable interactions requiring a decision, such as confirmation dialogs or small forms.
Usage
Dialogs are created with a fluent interface using the Tesserae.UI static helper. You can customize the dialog's header, content, and command buttons. Additional features include dark overlay and draggable mode. The example below initializes a dialog with a title, content, and custom command buttons.
API reference
public sealed class DialogA modal dialog with a title, body and configurable action buttons (OK / Cancel / custom).
Constructors
Properties
public bool IsDraggable { get ; set ; }Gets or sets a value indicating whether the component can be dragged by the user.
Methods
public Dialog Content(IComponent content)Sets the content rendered inside the surface.
public Dialog Commands(params IComponent[] content)Adds the given components to the dialog's command row.
public Dialog MinHeight(UnitSize unitSize)Gets or sets the CSS min-height of the component.
public Dialog Height(UnitSize unitSize)Gets or sets the CSS height of the component.
public void Ok(Action onOk, Func<Button, Button> btnOk = null)Shows OK button actions on the dialog and wires up the callback.
public void OkCancel(Action onOk = null, Action onCancel = null, Func<Button, Button> btnOk = null, Func<Button, Button> btnCancel = null)Shows OK / Cancel button actions on the dialog and wires up the callbacks.
public void YesNo(Action onYes = null, Action onNo = null, Func<Button, Button> btnYes = null, Func<Button, Button> btnNo = null)Shows Yes / No button actions on the dialog and wires up the callbacks.
public void YesNoCancel(Action onYes = null, Action onNo = null, Action onCancel = null, Func<Button, Button> btnYes = null, Func<Button, Button> btnNo = null, Func<Button, Button> btnCancel = null)Shows Yes / No / Cancel button actions on the dialog and wires up the callbacks.
public void RetryCancel(Action onRetry = null, Action onCancel = null, Func<Button, Button> btnRetry = null, Func<Button, Button> btnCancel = null)Shows Retry / Cancel button actions on the dialog and wires up the callbacks.
public Task<Response> OkAsync(Func<Button, Button> btnOk = null)Awaitable variant of that resolves with the user's response.
public Task<Response> OkCancelAsync(Func<Button, Button> btnOk = null, Func<Button, Button> btnCancel = null)Awaitable variant of that resolves with the user's response.
public Task<Response> YesNoAsync(Func<Button, Button> btnYes = null, Func<Button, Button> btnNo = null)Awaitable variant of that resolves with the user's response.
public Task<Response> YesNoCancelAsync(Func<Button, Button> btnYes = null, Func<Button, Button> btnNo = null, Func<Button, Button> btnCancel = null)Awaitable variant of that resolves with the user's response.
Samples
Basic Dialog Example
This sample demonstrates how to create a simple dialog with a title, content, and command buttons. It also shows how to enable draggable functionality.
Using Confirmation Methods
This sample illustrates the usage of the built-in confirmation methods such as YesNo and YesNoCancel.