Class ToastBuilder
Inheritance
System.Object
ToastBuilder
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: Syncfusion.EJ2.dll
Syntax
public class ToastBuilder : ControlBuilder
Constructors
ToastBuilder()
Declaration
ToastBuilder(Toast)
Declaration
public ToastBuilder(Toast model)
Parameters
Type |
Name |
Description |
Toast |
model |
|
Fields
model
Declaration
Field Value
Properties
HtmlAttr
Declaration
public IDictionary<string, object> HtmlAttr { get; set; }
Property Value
Type |
Description |
System.Collections.Generic.IDictionary<System.String, System.Object> |
|
ID
Declaration
public string ID { get; set; }
Property Value
Type |
Description |
System.String |
|
Output
Declaration
public override TextWriter Output { get; set; }
Property Value
Type |
Description |
System.IO.TextWriter |
|
Overrides
Methods
Animation(ToastToastAnimationSettings)
Specifies the animation configuration settings for showing and hiding the Toast.
Declaration
public ToastBuilder Animation(ToastToastAnimationSettings animation)
Parameters
Returns
Animation(Action<ToastToastAnimationSettingsBuilder>)
Declaration
public ToastBuilder Animation(Action<ToastToastAnimationSettingsBuilder> animation)
Parameters
Returns
BeforeClose(String)
Triggers the event before the toast close.
Declaration
public ToastBuilder BeforeClose(string beforeClose)
Parameters
Type |
Name |
Description |
System.String |
beforeClose |
|
Returns
BeforeOpen(String)
Triggers the event before the toast shown.
Declaration
public ToastBuilder BeforeOpen(string beforeOpen)
Parameters
Type |
Name |
Description |
System.String |
beforeOpen |
|
Returns
BeforeSanitizeHtml(String)
Event triggers before sanitize the value.
Declaration
public ToastBuilder BeforeSanitizeHtml(string beforeSanitizeHtml)
Parameters
Type |
Name |
Description |
System.String |
beforeSanitizeHtml |
|
Returns
Declaration
public ToastBuilder Buttons(Action<ToastButtonModelPropBuilder> buttons)
Parameters
Returns
Specifies the collection of Toast action buttons
to be rendered with the given
Button model properties and its click action handler.
Declaration
public ToastBuilder Buttons(List<ToastButtonModelProp> buttons)
Parameters
Returns
Click(String)
The event will be fired while clicking on the Toast.
Declaration
public ToastBuilder Click(string click)
Parameters
Type |
Name |
Description |
System.String |
click |
|
Returns
Close(String)
Trigger the event after the Toast hides.
Declaration
public ToastBuilder Close(string close)
Parameters
Type |
Name |
Description |
System.String |
close |
|
Returns
Content(String)
Specifies the content to be displayed on the Toast.
Accepts selectors, string values and HTML elements.
Declaration
public ToastBuilder Content(string content)
Parameters
Type |
Name |
Description |
System.String |
content |
|
Returns
ContentTemplate(Action<Object>)
Declaration
public ToastBuilder ContentTemplate(Action<object> template)
Parameters
Type |
Name |
Description |
System.Action<System.Object> |
template |
|
Returns
ContentTemplate(Func<Object, Object>)
Declaration
public ToastBuilder ContentTemplate(Func<object, object> template)
Parameters
Type |
Name |
Description |
System.Func<System.Object, System.Object> |
template |
|
Returns
Created(String)
Triggers the event after the Toast gets created.
Declaration
public ToastBuilder Created(string created)
Parameters
Type |
Name |
Description |
System.String |
created |
|
Returns
CssClass(String)
Defines single/multiple classes (separated by space) to be used for customization of Toast.
Declaration
public ToastBuilder CssClass(string cssClass)
Parameters
Type |
Name |
Description |
System.String |
cssClass |
|
Returns
Destroyed(String)
Triggers the event after the Toast gets destroyed.
Declaration
public ToastBuilder Destroyed(string destroyed)
Parameters
Type |
Name |
Description |
System.String |
destroyed |
|
Returns
EnableHtmlSanitizer(Boolean)
Defines whether to allow the cross-scripting site or not.
Declaration
public ToastBuilder EnableHtmlSanitizer(bool enableHtmlSanitizer = true)
Parameters
Type |
Name |
Description |
System.Boolean |
enableHtmlSanitizer |
|
Returns
EnablePersistence(Boolean)
Enable or disable persisting component's state between page reloads.
Declaration
public ToastBuilder EnablePersistence(bool enablePersistence = true)
Parameters
Type |
Name |
Description |
System.Boolean |
enablePersistence |
|
Returns
EnableRtl(Boolean)
Enable or disable rendering component in right to left direction.
Declaration
public ToastBuilder EnableRtl(bool enableRtl = true)
Parameters
Type |
Name |
Description |
System.Boolean |
enableRtl |
|
Returns
ExtendedTimeout(Double)
Specifies the Toast display time duration after interacting with the Toast.
Declaration
public ToastBuilder ExtendedTimeout(double extendedTimeout)
Parameters
Type |
Name |
Description |
System.Double |
extendedTimeout |
|
Returns
Height(Double)
Specifies the height of the Toast in pixels/number/percentage. Number value is considered as pixels.
Declaration
public ToastBuilder Height(double height)
Parameters
Type |
Name |
Description |
System.Double |
height |
|
Returns
Height(String)
Specifies the height of the Toast in pixels/number/percentage. Number value is considered as pixels.
Declaration
public ToastBuilder Height(string height)
Parameters
Type |
Name |
Description |
System.String |
height |
|
Returns
HtmlAttributes(Object)
Allows additional HTML attributes such as title, name, etc., and
accepts n number of attributes in a key-value pair format.
Declaration
public ToastBuilder HtmlAttributes(object htmlAttributes)
Parameters
Type |
Name |
Description |
System.Object |
htmlAttributes |
|
Returns
Icon(String)
Defines CSS classes to specify an icon for the Toast which is to be displayed at top left corner of the Toast.
Declaration
public ToastBuilder Icon(string icon)
Parameters
Type |
Name |
Description |
System.String |
icon |
|
Returns
Locale(String)
Overrides the global culture and localization value for this component. Default global culture is 'en-US'.
Declaration
public ToastBuilder Locale(string locale)
Parameters
Type |
Name |
Description |
System.String |
locale |
|
Returns
NewestOnTop(Boolean)
Specifies the newly created Toast message display order while multiple toast's are added to page one after another.
By default, newly added Toast will be added after old Toast's.
Declaration
public ToastBuilder NewestOnTop(bool newestOnTop = true)
Parameters
Type |
Name |
Description |
System.Boolean |
newestOnTop |
|
Returns
Open(String)
Triggers the event after the Toast shown on the target container.
Declaration
public ToastBuilder Open(string open)
Parameters
Type |
Name |
Description |
System.String |
open |
|
Returns
Position(ToastToastPosition)
Specifies the position of the Toast message to be displayed within target container.
In the case of multiple Toast display, new Toast position will not update on dynamic change of property values
until the old Toast messages removed.
X values are: Left , Right ,Center
Y values are: Top , Bottom
Declaration
public ToastBuilder Position(ToastToastPosition position)
Parameters
Returns
Position(Action<ToastToastPositionBuilder>)
Declaration
public ToastBuilder Position(Action<ToastToastPositionBuilder> position)
Parameters
Returns
ProgressDirection(ProgressDirectionType)
Specifies whether to show the progress bar with left to right direction to denote the Toast message display timeout.
Declaration
public ToastBuilder ProgressDirection(ProgressDirectionType progressDirection)
Parameters
Returns
Render()
Declaration
public HtmlString Render()
Returns
Type |
Description |
System.Web.HtmlString |
|
Specifies whether to show the close button in Toast message to close the Toast.
Declaration
public ToastBuilder ShowCloseButton(bool showCloseButton = true)
Parameters
Type |
Name |
Description |
System.Boolean |
showCloseButton |
|
Returns
ShowProgressBar(Boolean)
Specifies whether to show the progress bar to denote the Toast message display timeout.
Declaration
public ToastBuilder ShowProgressBar(bool showProgressBar = true)
Parameters
Type |
Name |
Description |
System.Boolean |
showProgressBar |
|
Returns
Target(String)
Specifies the target container where the Toast to be displayed.
Based on the target, the positions such as Left
, Top
will be applied to the Toast.
The default value is null, which refers the document.body
element.
Declaration
public ToastBuilder Target(string target)
Parameters
Type |
Name |
Description |
System.String |
target |
|
Returns
Template(String)
Specifies the HTML element/element ID as a string that can be displayed as a Toast.
The given template is taken as preference to render the Toast, even if the built-in properties such as title and content are defined.
Declaration
public ToastBuilder Template(string template)
Parameters
Type |
Name |
Description |
System.String |
template |
|
Returns
TimeOut(Double)
Specifies the Toast display time duration on the page in milliseconds.
- Once the time expires, Toast message will be removed.
- Setting 0 as a time out value displays the Toast on the page until the user closes it manually.
Declaration
public ToastBuilder TimeOut(double timeOut)
Parameters
Type |
Name |
Description |
System.Double |
timeOut |
|
Returns
Title(String)
Specifies the title to be displayed on the Toast.
Accepts selectors, string values and HTML elements.
Declaration
public ToastBuilder Title(string title)
Parameters
Type |
Name |
Description |
System.String |
title |
|
Returns
Width(Double)
Specifies the width of the Toast in pixels/numbers/percentage. Number value is considered as pixels.
In mobile devices, default width is considered as 100%
.
Declaration
public ToastBuilder Width(double width)
Parameters
Type |
Name |
Description |
System.Double |
width |
|
Returns
Width(String)
Specifies the width of the Toast in pixels/numbers/percentage. Number value is considered as pixels.
In mobile devices, default width is considered as 100%
.
Declaration
public ToastBuilder Width(string width)
Parameters
Type |
Name |
Description |
System.String |
width |
|
Returns