Avalonia Code OnlyItaliano

API › RAVAL

RDialog class

public static class RDialog

Modal message boxes, each in one awaited call.

Properties

static string Ok { get; set; }

The button that accepts a message («OK»).

static string Cancel { get; set; }

The button that gives up («Cancel»).

static string InfoTitle { get; set; }

The title of Info («Information»).

static string WarningTitle { get; set; }

The title of Warning («Warning»).

static string ErrorTitle { get; set; }

The title of Error («Error»).

static string ConfirmTitle { get; set; }

The title of Confirm («Confirm»).

static string InputTitle { get; set; }

The title of Ask («Input»).

static string Details { get; set; }

The header of the details of an exception («Details»).

Methods

static Task Info(Control owner, string text, string title = null)

A message with «OK».

static Task Warning(Control owner, string text, string title = null)

A warning with «OK».

static Task Error(Control owner, string text, Exception e = null, string title = null)

An error with «OK». With an exception, its message follows the text and the whole exception is under «Details», to copy; the error is also written in the log (RLog.Error), so it is not lost when the user closes the box.

static Task<bool> Confirm(Control owner, string question, string yes = null, string title = null)

A question with «Cancel» and the button that confirms (yes, «OK» if not given): true only if that button is pressed.

static Task<string> Ask(Control owner, string question, string initial = "", string title = null)

A text to ask, in a box already filled with initial and selected: the text written, or null if the user gives up.

static Task<int> Choose(Control owner, RDialogKind kind, string title, string text, params string[] buttons)

A choice among buttons, in the order given (the last one is Enter): the index of the button pressed, −1 for Esc or the close button.

static Task<int> Show(Control owner, RDialogBox box)

Opens a dialog built by the caller over the window of owner: the answer.

Events

event Action<RDialogBox> Opening

When a dialog is about to open, with its window: for the tests, for a log of what the user was asked, or to change it before it shows.