Toast

Wisej.Web.Toast

Namespace: Wisej.Web

Assembly: Wisej.Framework (4.0.0.0)

Displays a toast that can contain an icon and text.

public class Toast : Component

A toast is a small widget that displays a simple message and an icon above all other controls on the web page. Multiple toasts can appear at the same time and at different locations on the screen. By default, the toast will automatically close after the AutoCloseDelay milliseconds. When a toast is closed and the AutoDispose property is true, it is automatically disposed and cannot be reused. Otherwise it is reusable and it's application's responsibility to dispose it when no longer needed.

Constructors

Toast(text, icon)

Creates and initializes a new instance of the Toast class using the specified arguments.

Name
Type
Description

text

The text to display in the message box. Newlines (CRLF) are converted to <BR/> when the text doesn't contain any HTML.

icon

An icon name or URL.

Properties

Alignment

ContentAlignmentarrow-up-right: Returns or sets the location where to display the toast. The default is TopCenterarrow-up-right

AllowHtml

Booleanarrow-up-right: Returns or sets a value indicating that the control can display HTML in the Text property.

Newlines (CRLF) are converted to <BR/> when allowHtml is false, or when allowHtml is true and the text doesn't contain any html.

AutoCloseDelay

Int32arrow-up-right: Returns or sets the auto close delay in milliseconds. The default is 5000 (5 seconds).

AutoDispose

Booleanarrow-up-right: Return or sets a flag indicating whether the toast is automatically disposed when closed. The default is false.

BackColor

Colorarrow-up-right: Returns or sets the background color for the toast.

ForeColor

Colorarrow-up-right: Returns or sets the text color of the toast.

IconSource

Stringarrow-up-right: Returns or sets the icon name or URL to display in the toast.

Text

Stringarrow-up-right: Returns or sets the text to display in the toast.

Methods

Close()

Hides the toast.

Dispose(disposing)

Marks this component as disposed.

Parameter
Type
Description

disposing

true when this method is called by the application rather than a finalizer.

OnClick(e)

Fires the Click event.

Parameter
Type
Description

OnClosed(e)

Fires the Closed event.

Parameter
Type
Description

OnWebEvent(e)

Processes the event from the client.

Parameter
Type
Description

e

Event arguments.

OnWebRender(config)

Renders the client component.

Parameter
Type
Description

config

Dynamic configuration object.

Show()

Shows the toast.

Returns: Toast.

Events

Click

EventHandlerarrow-up-right Occurs when the user clicks the toast.

Closed

EventHandlerarrow-up-right Occurs when the toast is closed.

Implements

Name
Description

Provides access to the UserData and Tag properties associated to the component implementing this interface.

All wisej components implement this interface.

Allows an object to serialize itself.

Last updated

Was this helpful?