Class ToastShowAnimationSettings
Specifies the animation configuration settings to appear while showing the Toast notification.
Inheritance
Namespace: Syncfusion.Blazor.Notifications
Assembly: Syncfusion.Blazor.dll
Syntax
public class ToastShowAnimationSettings : OwningComponentBase
Remarks
This class defines the animation properties that control how a Toast notification appears on the screen. It allows customization of animation duration, easing effects, and animation types to enhance the user experience when displaying Toast notifications. The settings in this class only affect the show animation behavior.
Examples
A simple Toast with show animation settings.
<SfToast>
<ToastAnimationSettings>
<ToastShowAnimationSettings Duration="500" Effect="ToastEffect.FadeZoom" Easing="ToastEasing.Ease"></ToastShowAnimationSettings>
</ToastAnimationSettings>
</SfToast>
Constructors
ToastShowAnimationSettings()
Declaration
public ToastShowAnimationSettings()
Properties
Duration
Gets or sets the duration of the show animation in milliseconds.
Declaration
public int Duration { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | An integer value representing the animation duration in milliseconds. The default value is typically 400ms. |
Remarks
This property controls how long the show animation takes to complete when a Toast notification appears. A higher value results in a slower animation, while a lower value creates a faster animation effect. The duration works in conjunction with the Easing property to create smooth animation transitions.
Examples
Setting a custom animation duration.
<ToastShowAnimationSettings Duration="600" />
Easing
Gets or sets the easing function for the show animation timing.
Declaration
public ToastEasing Easing { get; set; }
Property Value
Type | Description |
---|---|
ToastEasing | A ToastEasing enumeration value that determines the acceleration curve of the animation. |
Remarks
The easing function controls the rate of change of the animation over time, creating different animation feels such as smooth acceleration, deceleration, or bouncing effects. This property works in combination with the Duration to create polished animation experiences. Common easing options include linear, ease-in, ease-out, and ease-in-out transitions.
Examples
Setting an easing function for smooth animation.
<ToastShowAnimationSettings Easing="ToastEasing.EaseInOut" Duration="500" />
Effect
Gets or sets the animation effect that should be applied when showing the toast notification.
Declaration
public ToastEffect Effect { get; set; }
Property Value
Type | Description |
---|---|
ToastEffect | A ToastEffect enumeration value that specifies the type of animation effect to use during the show animation. |
Remarks
This property determines the visual style of the show animation. Each effect provides a different visual experience when the Toast appears on screen. The available animation effects include:
- Fade - Simple fade-in transparency effect
- FadeZoom - Combined fade and scaling effect
- FlipLeftDown - 3D flip animation from left to down
- FlipLeftUp - 3D flip animation from left to up
- FlipRightDown - 3D flip animation from right to down
- FlipRightUp - 3D flip animation from right to up
- FlipXDown - Horizontal flip animation downward
- FlipXUp - Horizontal flip animation upward
- FlipYLeft - Vertical flip animation leftward
- FlipYRight - Vertical flip animation rightward
- SlideBottom - Slide animation from bottom
- SlideLeft - Slide animation from left
- SlideRight - Slide animation from right
- SlideTop - Slide animation from top
- Zoom - Scaling effect from center
- None - No animation effect (immediate display)
Examples
Setting different animation effects.
<!-- Fade effect -->
<ToastShowAnimationSettings Effect="ToastEffect.Fade" Duration="400" />
<!-- Slide from right effect -->
<ToastShowAnimationSettings Effect="ToastEffect.SlideRight" Duration="600" />
Methods
Dispose()
Releases all resources used by the ToastShowAnimationSettings component.
Declaration
public virtual void Dispose()
Remarks
This method implements the IDisposable pattern and ensures proper cleanup of component resources. It calls the protected Dispose method with true to indicate that the disposal is explicit.
Dispose(Boolean)
Releases the unmanaged resources used by the ToastShowAnimationSettings and optionally releases the managed resources.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | true to release both managed and unmanaged resources; false to release only unmanaged resources. |
Remarks
This method is called by the public Dispose method and the finalizer. When disposing is true, this method releases all resources held by managed objects that this ToastShowAnimationSettings references. It properly nullifies the ChildContent and Parent references to prevent memory leaks.
OnParametersSetAsync()
Method invoked when the component has received parameters from its parent component.
Declaration
protected override Task OnParametersSetAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A Task representing the asynchronous operation of processing parameter updates. |
Remarks
This method is part of the Blazor component lifecycle and is called whenever the component's parameters are updated by the parent component. It ensures that animation settings are properly communicated to the parent ToastAnimationSettings component for coordinated animation behavior.