Skip to main content

Modal Window

Class: ModalWindow

To create a modal window you need to use SmartifyOS.UI

Create

public static ModalWindow Create()

Creates a new ModalWindow

Returns
ModalWindowThe created ModalWindow

Init

public void Init(string title, string content, ModalType modalType, Action confirm, Action cancel)

Initializes the ModalWindow

Parameters
titleTitle of the window
contentText of the window
modalTypeWhat type of modal this is
confirmCallback when the confirm button is pressed
cancelCallback when the cancel button is pressed

ModalTypes

ModalTypes
ModalType.Okay
ModalType.OkayCancel
ModalType.YesNo
ModalType.YesCancel
public void Init(string title, string content, string confirmText, string cancelText, Action confirm, Action cancel)

Initializes the ModalWindow with custom button texts

Parameters
titleTitle of the window
contentText of the window
confirmTextConfirm button text
cancelTextCancel button text
confirmCallback when the confirm button is pressed
cancelCallback when the cancel button is pressed

UpdateContent

public void UpdateContent(string content)

Updates the content of the ModalWindow

Parameters
contentNew content string

Close

public void Close()

Closes the ModalWindow