Class TwToastServiceExtensions
Extension methods for ITwToastService to simplify toast creation.
public static class TwToastServiceExtensions
- Inheritance
-
TwToastServiceExtensions
- Inherited Members
Methods
Show(ITwToastService, string, string?, Color?, Icon?, int)
Shows a custom toast notification.
public static void Show(this ITwToastService service, string title, string? message = null, Color? color = null, Icon? icon = null, int duration = 5000)
Parameters
serviceITwToastServiceThe toast service.
titlestringThe title of the toast.
messagestringThe message content.
colorColor?The color theme of the toast.
iconIcon?The icon to display.
durationintThe duration in milliseconds before auto-dismiss. Default is 5000ms.
ShowError(ITwToastService, string, string?, int)
Shows an error toast notification.
public static void ShowError(this ITwToastService service, string title, string? message = null, int duration = 5000)
Parameters
serviceITwToastServiceThe toast service.
titlestringThe title of the toast.
messagestringThe message content.
durationintThe duration in milliseconds before auto-dismiss. Default is 5000ms.
ShowInfo(ITwToastService, string, string?, int)
Shows an info toast notification.
public static void ShowInfo(this ITwToastService service, string title, string? message = null, int duration = 5000)
Parameters
serviceITwToastServiceThe toast service.
titlestringThe title of the toast.
messagestringThe message content.
durationintThe duration in milliseconds before auto-dismiss. Default is 5000ms.
ShowSuccess(ITwToastService, string, string?, int)
Shows a success toast notification.
public static void ShowSuccess(this ITwToastService service, string title, string? message = null, int duration = 5000)
Parameters
serviceITwToastServiceThe toast service.
titlestringThe title of the toast.
messagestringThe message content.
durationintThe duration in milliseconds before auto-dismiss. Default is 5000ms.
ShowWarning(ITwToastService, string, string?, int)
Shows a warning toast notification.
public static void ShowWarning(this ITwToastService service, string title, string? message = null, int duration = 5000)
Parameters
serviceITwToastServiceThe toast service.
titlestringThe title of the toast.
messagestringThe message content.
durationintThe duration in milliseconds before auto-dismiss. Default is 5000ms.