Class MessageButton
- Namespace
- GroupeIsa.Neos.Designer.UIAbstractions.Message
- Assembly
- GroupeIsa.Neos.Designer.UIAbstractions.dll
Represents a button in a message.
[ExcludeFromCodeCoverage]
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
typeMessageButtonTypeType.
autofocusboolA 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 = null, bool autofocus = false, Func<string?, bool>? isDisabled = null)
Parameters
customIdintIdentifier for the Custom type.
customTextstringText for the Custom type.
iconstringIcon for the Custom type.
autofocusboolValue indicating whether this button is focused when the message box is displayed.
isDisabledFunc<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.
// String literals here ("Question", "Are you ready?") are simplified for readability.
// Real rule/action/method code must use UIResources.[Module].[ResourceName] instead of hardcoded text.
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; }