New to Telerik UI for ASP.NET Core? Start a free 30-day trial

Defines the fluent API for configuring the Kendo UI Notification

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class NotificationBuilder : WidgetBuilderBase<Notification, NotificationBuilder>, IHtmlContent

Inheritance: objectHelperResultWidgetBuilderBase<Notification, NotificationBuilder>NotificationBuilder

Implements: IHtmlContent

Inherited Members WidgetBuilderBase<Notification, NotificationBuilder>.ToComponent()WidgetBuilderBase<Notification, NotificationBuilder>.Expression(string)WidgetBuilderBase<Notification, NotificationBuilder>.Explorer(ModelExplorer)WidgetBuilderBase<Notification, NotificationBuilder>.Name(string)WidgetBuilderBase<Notification, NotificationBuilder>.Deferred(bool)WidgetBuilderBase<Notification, NotificationBuilder>.HtmlAttributes(object)WidgetBuilderBase<Notification, NotificationBuilder>.HtmlAttributes(IDictionary<string, object>)WidgetBuilderBase<Notification, NotificationBuilder>.ScriptAttributes(object, bool)WidgetBuilderBase<Notification, NotificationBuilder>.ScriptAttributes(IDictionary<string, object>, bool)WidgetBuilderBase<Notification, NotificationBuilder>.Render()WidgetBuilderBase<Notification, NotificationBuilder>.ToHtmlString()WidgetBuilderBase<Notification, NotificationBuilder>.WriteTo(TextWriter, HtmlEncoder)WidgetBuilderBase<Notification, NotificationBuilder>.ToClientTemplate()WidgetBuilderBase<Notification, NotificationBuilder>.AsModule(bool)WidgetBuilderBase<Notification, NotificationBuilder>.ComponentWidgetBuilderBase<Notification, NotificationBuilder>.ContainerHelperResult.WriteTo(TextWriter, HtmlEncoder)HelperResult.WriteActionobject.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

Initializes a new instance of the NotificationBuilder class.

C#
public NotificationBuilder(Notification component)
Parameters:componentNotification

Methods

Indicates the period in milliseconds after which a notification can be dismissed (hidden) by the user.

C#
public NotificationBuilder AllowHideAfter(double value)
Parameters:valuedouble

The value for AllowHideAfter

Returns:

NotificationBuilder

Returns the current NotificationBuilder instance.

Example:
C#
@( Html.Kendo().Notification()
.Name("Notification")
.AllowHideAfter(500)
)

Configures the animation effects of the displayed notifications.

C#
public NotificationBuilder Animation(Action<PopupAnimationBuilder> animationAction)
Parameters:animationActionAction<PopupAnimationBuilder>

The action that configures the animation.

Returns:

NotificationBuilder

Returns the current instance of NotificationBuilder.

Example:
C#
@( Html.Kendo().Notification()
.Name("Notification")
.Animation(a=&gt;a.Open(o=&gt;o.Duration(300).SlideIn(SlideDirection.Up)))
)

Defines the element to which the notifications will be appended or prepended (depending on the stacking direction).

C#
public NotificationBuilder AppendTo(string value)
Parameters:valuestring

The value for AppendTo

Returns:

NotificationBuilder

Returns the current NotificationBuilder instance.

Example:
C#
@( Html.Kendo().Notification()
.Name("Notification")
.AppendTo("value")
)

Indicates the period in milliseconds after which a notification disappears automatically. Setting a zero value disables this behavior.

C#
public NotificationBuilder AutoHideAfter(double value)
Parameters:valuedouble

The value for AutoHideAfter

Returns:

NotificationBuilder

Returns the current NotificationBuilder instance.

Example:
C#
@( Html.Kendo().Notification()
.Name("Notification")
.AutoHideAfter(500)
)

Determines whether the notifications will include a hide button. This setting works with the built-in templates only.

C#
public NotificationBuilder Button()
Returns:

NotificationBuilder

Returns the current NotificationBuilder instance.

Determines whether the notifications will include a hide button. This setting works with the built-in templates only.

C#
public NotificationBuilder Button(bool value)
Parameters:valuebool

The value for Button

Returns:

NotificationBuilder

Returns the current NotificationBuilder instance.

Example:
C#
@( Html.Kendo().Notification()
.Name("Notification")
.Button(true)
)

Configures the client-side events.

C#
public NotificationBuilder Events(Action<NotificationEventBuilder> configurator)
Parameters:configuratorAction<NotificationEventBuilder>

The client events action.

Returns:

NotificationBuilder

Returns the current NotificationBuilder instance.

Example:
C#
@(Html.Kendo().Notification()
.Name("Notification")
.Events(events =&gt; events
.Hide("onHide")
)
)

Defines the height of the notifications to be displayed.

C#
public NotificationBuilder Height(int value)
Parameters:valueint

The value of the setting.

Returns:

NotificationBuilder

Returns the current instance of NotificationBuilder.

Example:
C#
@( Html.Kendo().Notification()
.Name("Notification")
.Height(100)
)

Defines the notifications' height. Numbers are treated as pixels.

C#
public NotificationBuilder Height(string value)
Parameters:valuestring

The value for Height

Returns:

NotificationBuilder

Returns the current NotificationBuilder instance.

Example:
C#
@( Html.Kendo().Notification()
.Name("Notification")
.Height(100)
)

Determines whether notifications can be hidden by clicking anywhere on their content.

C#
public NotificationBuilder HideOnClick(bool value)
Parameters:valuebool

The value for HideOnClick

Returns:

NotificationBuilder

Returns the current NotificationBuilder instance.

Example:
C#
@( Html.Kendo().Notification()
.Name("Notification")
.HideOnClick(true)
)

This setting applies to popup notifications only, i.e. in cases when appendTo is not set. It determines the position of the first notification on the screen, as well as whether the notifications will move together with the page content during scrolling. top takes precedence over bottom and left takes precedence over right.

C#
public NotificationBuilder Position(Action<NotificationPositionSettingsBuilder> configurator)
Parameters:configuratorAction<NotificationPositionSettingsBuilder>

The NotificationPositionSettingsBuilder for the position setting.

Returns:

NotificationBuilder

Returns the current instance of NotificationBuilder .

Determines the direction in which multiple notification will stack (arrange) with regard to the first one. Possible values are "up", "right", "down", "left" and "default". The "default" setting takes into consideration the applied position settings and is evaluated to "up" or "down".

C#
public NotificationBuilder Stacking(NotificationStackingSettings value)
Parameters:valueNotificationStackingSettings

The value for Stacking

Returns:

NotificationBuilder

Returns the current NotificationBuilder instance.

Example:
C#
@( Html.Kendo().Notification()
.Name("Notification")
.Stacking(NotificationStackingSettings.Down)
)

Sets the Notification HTML tag. A SPAN tag is used by default.

C#
public NotificationBuilder Tag(string tag)
Parameters:tagstring

The tag type value.

Returns:

NotificationBuilder

Returns the current instance of NotificationBuilder.

Example:
C#
@( Html.Kendo().Notification()
.Name("Notification")
.Tag("div")
)

Configures the Notification templates.

C#
public NotificationBuilder Templates(Action<NotificationTemplateFactory> configurator)
Parameters:configuratorAction<NotificationTemplateFactory>

The configurator representing the Templates settings.

Returns:

NotificationBuilder

Returns the current instance of NotificationBuilder.

Example:
C#
@( Html.Kendo().Notification()
.Name("Notification")
.Templates(t=&gt;t.Add().Type("info"))
)

Defines the title attribute value for the Notification wrapper.

C#
public NotificationBuilder Title(string value)
Parameters:valuestring

The value for Title

Returns:

NotificationBuilder

Returns the current NotificationBuilder instance.

Example:
C#
@( Html.Kendo().Notification()
.Name("Notification")
.Title("value")
)

Defines the width of the notifications to be displayed.

C#
public NotificationBuilder Width(int value)
Parameters:valueint

The value of the setting.

Returns:

NotificationBuilder

Returns the current instance of NotificationBuilder.

Example:
C#
@( Html.Kendo().Notification()
.Name("Notification")
.Width(200)
)

Defines the notifications' width. Numbers are treated as pixels.

C#
public NotificationBuilder Width(string value)
Parameters:valuestring

The value for Width

Returns:

NotificationBuilder

Returns the current NotificationBuilder instance.

Example:
C#
@( Html.Kendo().Notification()
.Name("Notification")
.Width(200)
)