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
MessageButtonTypeType.
autofocus
boolA 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
intIdentifier for the Custom type.
customText
stringText for the Custom type.
icon
stringIcon for the Custom type.
autofocus
boolValue 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
Icon
Gets or sets the icon for the Custom type.
public string? Icon { get; set; }
Property Value
IsDisabled
Gets or sets a function indicating whether the button is disabled.
public Func<string?, bool>? IsDisabled { get; set; }
Property Value
Type
Gets or sets the type.
public MessageButtonType Type { get; set; }