Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class DialogOptions

    Show / Hide Table of Contents

    Class DialogOptions

    Provides options to configure built-in dialogs shown using ConfirmAsync(String, String, DialogOptions), AlertAsync(String, String, DialogOptions) and PromptAsync(String, String, DialogOptions) methods.

    Inheritance
    System.Object
    DialogOptions
    Namespace: Syncfusion.Blazor.Popups
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class DialogOptions : Object

    Constructors

    DialogOptions()

    Declaration
    public DialogOptions()

    Properties

    AllowDragging

    Gets or sets whether the dialog can be dragged by the end-user.

    Declaration
    public bool AllowDragging { get; set; }
    Property Value
    Type Description
    System.Boolean

    true, if the dialog can be dragged by the user; Otherwise, false. The default value is false.

    Remarks

    When AllowDragging is set as true it allows a user to drag by selecting the header and dragging it for repositioning the dialog.

    AnimationSettings

    Gets or sets the animation settings of the dialog component.

    Declaration
    public DialogAnimationOptions AnimationSettings { get; set; }
    Property Value
    Type Description
    DialogAnimationOptions

    DialogAnimationSettings

    Remarks

    The animation effect can be applied to open and close the dialog with duration and delay.

    CancelButtonOptions

    Gets or sets the cancel action settings.

    Declaration
    public DialogButtonOptions CancelButtonOptions { get; set; }
    Property Value
    Type Description
    DialogButtonOptions

    DialogButtonOptions

    See Also
    PrimaryButtonOptions

    ChildContent

    Gets or sets a template content that used as content dialog.

    Declaration
    public RenderFragment ChildContent { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.RenderFragment

    The template content.

    Examples

    In the code example below, the child content is configured for the prompt dialog box.

    await DialogService.PromptAsync(null, "Enter Your Details", new DialogOptions()
    {
        ChildContent = @<SfTextBox Placeholder = "Enter Name"></SfTextBox>
    });

    CloseOnEscape

    Gets or sets whether the dialog can be closed by pressing the escape (ESC) key.

    Declaration
    public bool CloseOnEscape { get; set; }
    Property Value
    Type Description
    System.Boolean

    true, if the dialog can be closed by pressing the escape (ESC) key; otherwise, false. The default value is true.

    See Also
    ShowCloseIcon

    CssClass

    Gets or sets the CSS class name that can be appended with the root element of the utility dialog.

    Declaration
    public string CssClass { get; set; }
    Property Value
    Type Description
    System.String

    The default value is String.Empty.

    Remarks

    One or more custom CSS classes can be added to a utility dialog.

    Height

    Gets or sets the height of the dialog..

    Declaration
    public string Height { get; set; }
    Property Value
    Type Description
    System.String

    The default value is auto.

    See Also
    Width

    Position

    Gets or sets the value where the utility dialog can be positioned within the document or target.

    Declaration
    public PositionDataModel Position { get; set; }
    Property Value
    Type Description
    PositionDataModel

    The position can be represented with pre-configured positions or specific X and Y values. PositionDataModel.X can be configured with a left, center, right, or offset value. PositionDataModel.Y can be configured with a top, center, bottom, or offset value. PositionDataModel

    PrimaryButtonOptions

    Gets or sets the primary (OK) action button settings.

    Declaration
    public DialogButtonOptions PrimaryButtonOptions { get; set; }
    Property Value
    Type Description
    DialogButtonOptions

    DialogButtonOptions

    See Also
    CancelButtonOptions

    ShowCloseIcon

    Gets or sets whether to show the close icon in the title of dialog.

    Declaration
    public bool ShowCloseIcon { get; set; }
    Property Value
    Type Description
    System.Boolean

    true, the close icon is displayed in the dialog title section; otherwise, false. The default value is false.

    See Also
    CloseOnEscape

    Width

    Gets or sets the width of the dialog..

    Declaration
    public string Width { get; set; }
    Property Value
    Type Description
    System.String

    The default value is auto.

    See Also
    Height

    ZIndex

    Gets or sets the z-order that determines whether the utility dialog is displayed in front or behind of another component.

    Declaration
    public int ZIndex { get; set; }
    Property Value
    Type Description
    System.Int32

    The ZIndex value range can be changed depending on the application's needs. The default value is 1000.

    See Also
    CssClass
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved