Toast

Displays an informational popup on the screen.

Unlike the MessageBox and AlertBox, which are static classes, the Toast is a component that you create and can hold on to in your application. You can reuse it and you can update the content while the Toast is visible.

It can be located in any of the 9 standard locations. By default it appears at the TopCenter location. It contains an icon and a text that can display any HTML content (by setting the AllowHtml property to true).

Toasts auto close by default after 5 seconds but they do not auto dispose. To auto dispose a toast instance when it's closed, set the AutoDispose property to true. You can detect when the user clicks on a Toast by handling the Click event, and handle the Close event to run code when the Toast is closed.

For a full list of properties, methods and events see the API documentation.

Features

Delayed Closing

The AutoCloseDelay property can specify how long the toast is to be shown for.

HTML

The Toast control can show HTML in it's message by setting the AllowHtml property to true.

var toast = new Toast
{
	AllowHtml = true,
	Text = @"<ul>
	  <li>Coffee</li>
	  <li>Tea</li>
	  <li>Milk</li>
	  </ul>"
};
toast.Show();

Advanced

JavaScript Widget

ItemDescription

Class name

"wisej.web.Toast"

Theme appearance

"toast", see Themes.

Source code

Last updated