Class UiModalParameters
Parameters for configuring a UI modal component.
Includes title, text, alignment, buttons, and associated signal type.
Namespace: Serenity.Modal.Application.Components
Assembly: Serenity.Modal.Application.dll
Syntax
public class UiModalParameters : UiComponentParameters, IUiModalParameters, IUiComponentParameters, IComponentParameters, IFoundationSettings
Constructors
UiModalParameters()
Initializes a new instance of the UiModalParameters class with default values.
Declaration
public UiModalParameters()
UiModalParameters(string, string, string, string, string, float, UiComponentAlignmentType, IFoundationViewElementFactory, AudioPlayerPlayClip, string, IUiThemeSounds, List<IUiInteractable>, List<SerializedComponentData>)
Initializes a new instance of the UiModalParameters class.
Declaration
public UiModalParameters(string id, string guid, string signalTypeName, string title, string text, float textFontSize, UiComponentAlignmentType alignment, IFoundationViewElementFactory foundationViewElementFactory, AudioPlayerPlayClip audioPlayerPlayClip, string audioServiceId, IUiThemeSounds themeSounds, List<IUiInteractable> buttons, List<SerializedComponentData> serializedButtons)
Parameters
| Type | Name | Description |
|---|---|---|
| string | id | The unique identifier for the modal. |
| string | guid | The globally unique identifier for the modal. |
| string | signalTypeName | The assembly qualified name of the signal type associated with the modal. |
| string | title | The title of the modal. |
| string | text | The main text content of the modal. |
| float | textFontSize | The font size of the main text. |
| UiComponentAlignmentType | alignment | The alignment of the modal content. |
| IFoundationViewElementFactory | foundationViewElementFactory | Factory for creating foundation view elements. |
| AudioPlayerPlayClip | audioPlayerPlayClip | Delegate for playing audio clips. |
| string | audioServiceId | The ID of the audio service to use. |
| IUiThemeSounds | themeSounds | The theme sounds associated with the modal. |
| List<IUiInteractable> | buttons | The list of buttons in the modal. |
| List<SerializedComponentData> | serializedButtons | Serialized data for reconstructing button components. |
Fields
Alignment
Declaration
public UiComponentAlignmentType Alignment
Field Value
| Type | Description |
|---|---|
| UiComponentAlignmentType | The alignment of the modal content. |
Buttons
Declaration
public List<IUiInteractable> Buttons
Field Value
| Type | Description |
|---|---|
| List<IUiInteractable> | The list of buttons in the modal. |
Direction
Declaration
public ModalDirection Direction
Field Value
| Type | Description |
|---|---|
| ModalDirection | The axis along which the modal lays out its options. |
IsTranslatingText
Declaration
public bool IsTranslatingText
Field Value
| Type | Description |
|---|---|
| bool | Whether the text is treated as a localization key and translated at runtime. |
IsTranslatingTitle
Declaration
public bool IsTranslatingTitle
Field Value
| Type | Description |
|---|---|
| bool | Whether the title is treated as a localization key and translated at runtime. |
Options
Declaration
public UiOption[] Options
Field Value
| Type | Description |
|---|---|
| UiOption[] | Rich options that built the modal's interactables (modelled like menu options). |
OptionsGap
Declaration
public float OptionsGap
Field Value
| Type | Description |
|---|---|
| float | The spacing between consecutive options. |
Scrollable
Declaration
public bool Scrollable
Field Value
| Type | Description |
|---|---|
| bool | Whether the options area clamps to VisibleOptionsCount and scrolls the rest. |
SerializedButtons
Declaration
public List<SerializedComponentData> SerializedButtons
Field Value
| Type | Description |
|---|---|
| List<SerializedComponentData> | Serialized data for reconstructing button components. |
SignalTypeName
Declaration
public string SignalTypeName
Field Value
| Type | Description |
|---|---|
| string | The assembly qualified name of the signal type associated with the modal. |
Text
Declaration
public string Text
Field Value
| Type | Description |
|---|---|
| string | The main text content of the modal. |
TextFontSize
Declaration
public float TextFontSize
Field Value
| Type | Description |
|---|---|
| float | The font size of the main text. |
Title
Declaration
public string Title
Field Value
| Type | Description |
|---|---|
| string | The title of the modal. |
VisibleOptionsCount
Declaration
public int VisibleOptionsCount
Field Value
| Type | Description |
|---|---|
| int | How many options are visible at once when Scrollable is on; 0 or less disables clamping. |
Methods
GetSignalInstance()
Declaration
public EventDispatcherSignal GetSignalInstance()
Returns
| Type | Description |
|---|---|
| EventDispatcherSignal | Creates an instance of the signal type specified by SignalTypeName. |