Skip to content

MessageWindow

Class in Oadm.Sdk.Client.Controls · Oadm.Sdk.Client.dll

The message and confirmation dialog of the host and of plugin dialogs (one window, never a copy): title bar, the message, and a DialogFooter with Cancel on the left and the primary confirm button on the right. Use MessageWindow.ConfirmAsync / MessageWindow.ShowMessageAsync; the window size follows the message. A confirm button that deletes or removes something (MessageWindow.IsDestructive) is the red Button.danger.

public sealed class MessageWindow : Window

Inherits Window

Guide: UI kit

Button CancelButton { get; }

The Cancel button (for tests).

string? CancelText { get; set; }

Text of the Cancel button; null or empty hides it (a plain message with OK only).

Button ConfirmButton { get; }

The confirm button (for tests).

string? ConfirmText { get; set; }

The text of the confirm button; red when it starts with Delete, Remove or Release.

string? Heading { get; set; }

The window title (title bar and task switcher).

bool IsDanger { get; set; }

The confirm button is the red danger button (set from MessageWindow.ConfirmText; can be overridden).

string? Message { get; set; }

The message.

static Task<bool> ConfirmAsync(Window owner, string title, string message, string confirmText, string cancelText = "Cancel")

Asks for confirmation; true when the user clicked confirmText.

static bool IsDestructive(string? confirmText)

True for confirm texts of irreversible actions: they start with Delete, Remove, Release or Format (“Delete all”, “Remove”, “Release”, “Format”: formatting deletes the recordings). One rule for the host and every plugin.

static Task ShowMessageAsync(Window owner, string title, string message)

Shows a message with an OK button.