Table of Contents

Class MessageButton

Namespace
GroupeIsa.Neos.Designer.UIAbstractions.Message
Assembly
GroupeIsa.Neos.Designer.UIAbstractions.dll

Represents a button in a message.

public class MessageButton
Inheritance
MessageButton
Inherited Members

Constructors

MessageButton(MessageButtonType, bool)

Initializes a new instance of the MessageButton class.

public MessageButton(MessageButtonType type, bool autofocus = false)

Parameters

type MessageButtonType

Type.

autofocus bool

A value indicating whether this button is focused when the message box is displayed.

MessageButton(int, string, string, bool, Func<string?, bool>?)

Initializes a new instance of the MessageButton class.

public MessageButton(int customId, string customText, string icon, bool autofocus = false, Func<string?, bool>? isDisabled = null)

Parameters

customId int

Identifier for the Custom type.

customText string

Text for the Custom type.

icon string

Icon for the Custom type.

autofocus bool

Value indicating whether this button is focused when the message box is displayed.

isDisabled Func<string, bool>

Function indicating whether the button is disabled.

Properties

AutoFocus

Gets or sets a value indicating whether this button is focused when the message box is displayed.

public bool? AutoFocus { get; set; }

Property Value

bool?

Examples

The following example shows how to set the initial focus on button Yes.

IMessageResponse response = await ShowMessageAsync(MessageType.Info, "Question", "Are you ready?", new MessageButton(MessageButtonType.Yes, true), new MessageButton(MessageButtonType.No));
if (response.ButtonType == MessageButtonType.Yes)
{
    Start();
}

CustomId

Gets or sets the identifier for the Custom type.

public int? CustomId { get; set; }

Property Value

int?

CustomText

Gets or sets the text for the Custom type.

public string? CustomText { get; set; }

Property Value

string

Icon

Gets or sets the icon for the Custom type.

public string? Icon { get; set; }

Property Value

string

IsDisabled

Gets or sets a function indicating whether the button is disabled.

public Func<string?, bool>? IsDisabled { get; set; }

Property Value

Func<string, bool>

Type

Gets or sets the type.

public MessageButtonType Type { get; set; }

Property Value

MessageButtonType