Class MBConfirmationDialog
A confirmation dialog requiring the user to type in either a generated six digit sequence or a string provided in ConfirmationPhrase. The consumer can elect to use standard "OK" and "Cancel" buttons by leaving UnconfirmedButtons and ConfirmedButtons null, in which case the "OK" button gives the dialog an action result of ConfirmActionResult, or CancelActionResult for the "Cancel" button.
Alternatively the consumer can supply render fragments with buttons to UnconfirmedButtons and ConfirmedButtons. The former is rendered until the correct confirmation text is entered into the text box at which point it is replaced with the latter. Typically these are identical save that one or more of the repeated buttons in UnconfirmedButtons is disabled, but not in ConfirmedButtons. This components throws an ArgumentException if one of these render fragments is set while the other is not.
public class MBConfirmationDialog : ComponentFoundation, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
- Inheritance
-
MBConfirmationDialog
- Implements
- Inherited Members
Constructors
MBConfirmationDialog()
public MBConfirmationDialog()
Fields
CancelActionResult
Action result value for when the user cancels the dialog.
public const string CancelActionResult = "cancel"
Field Value
ConfirmActionResult
Action result value for when the user confirms the dialog.
public const string ConfirmActionResult = "confirm"
Field Value
Properties
ActionPhrase
The phrase following ConfirmationPhrase in the confirmation paragraph. "Please type ConfirmationPhraseActionPhrase"
[Parameter]
public string ActionPhrase { get; set; }
Property Value
Body
The dialog body, with the confirmation paragraph rendered beneath it and the confirmation text field beneath that.
[Parameter]
public RenderFragment Body { get; set; }
Property Value
ConfirmationDisabled
Disables the confirmation text field if True.
[Parameter]
public bool ConfirmationDisabled { get; set; }
Property Value
ConfirmationPhrase
Optional confirmation text. If omitted a random six digit code is generated for confirmation.
[Parameter]
public string ConfirmationPhrase { get; set; }
Property Value
ConfirmedButtons
A render fragment containing buttons in the confirmed state, typically none disabled and they should otherwise UnconfirmedButtons. Both this and UnconfirmedButtons should be set or both null in unison.
[Parameter]
public RenderFragment ConfirmedButtons { get; set; }
Property Value
OverflowVisible
Dialogs by default apply overflow: hidden;
. This means that selects or datepickers are often
cropped. Set this parameter to true to make the dialog apply overflow: visible;
to rectify this.
Defaults to false.
[Parameter]
public bool OverflowVisible { get; set; }
Property Value
Title
The dialog title.
[Parameter]
public string Title { get; set; }
Property Value
UnconfirmedButtons
A render fragment containing buttons in the unconfirmed state, typically one or more should be disabled. Both this and ConfirmedButtons should be set or both null in unison.
[Parameter]
public RenderFragment UnconfirmedButtons { get; set; }
Property Value
Methods
BuildRenderTree(RenderTreeBuilder)
Renders the component to the supplied RenderTreeBuilder.
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builder
RenderTreeBuilder
HideAsync()
Hides the dialog.
public Task HideAsync()
Returns
OnParametersSetAsync()
When overriding this, call await base.OnParametersSetAsync();
before any user code unless there is a very good reason not to.
protected override Task OnParametersSetAsync()
Returns
ShowAsync()
Shows the dialog.
public Task<string> ShowAsync()