功能更新
This commit is contained in:
44
Melskin/Controls/Toast/IToastService.cs
Normal file
44
Melskin/Controls/Toast/IToastService.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
namespace Melskin.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// 定义了用于显示轻量级通知的方法。此接口支持多种类型的提示消息,包括成功、错误、警告和信息等,并允许设置消息的显示时长。
|
||||
/// 通过实现该接口的服务,可以在应用或特定窗口中展示相应的通知。
|
||||
/// </summary>
|
||||
public interface IToastService
|
||||
{
|
||||
/// <summary>
|
||||
/// 显示一条轻量级通知。
|
||||
/// </summary>
|
||||
/// <param name="message">要显示的消息内容。</param>
|
||||
/// <param name="type">消息的类型,默认为信息类型。可选值包括成功、信息、错误和警告等。</param>
|
||||
/// <param name="duration">消息的显示时长。如果未指定,则使用默认值。</param>
|
||||
void Show(string message, ToastType type = ToastType.Info, TimeSpan? duration = null);
|
||||
|
||||
/// <summary>
|
||||
/// 显示一条成功类型的轻量级通知。
|
||||
/// </summary>
|
||||
/// <param name="message">要显示的消息内容。</param>
|
||||
/// <param name="duration">消息的显示时长。如果未指定,则使用默认值。</param>
|
||||
void ShowSuccess(string message, TimeSpan? duration = null);
|
||||
|
||||
/// <summary>
|
||||
/// 显示一条错误类型的轻量级通知。
|
||||
/// </summary>
|
||||
/// <param name="message">要显示的错误消息内容。</param>
|
||||
/// <param name="duration">消息的显示时长。如果未指定,则使用默认值。</param>
|
||||
void ShowError(string message, TimeSpan? duration = null);
|
||||
|
||||
/// <summary>
|
||||
/// 显示一条警告类型的轻量级通知。
|
||||
/// </summary>
|
||||
/// <param name="message">要显示的消息内容。</param>
|
||||
/// <param name="duration">消息的显示时长,如果未指定则使用默认值。</param>
|
||||
void ShowWarning(string message, TimeSpan? duration = null);
|
||||
|
||||
/// <summary>
|
||||
/// 显示一条信息类型的轻量级通知。
|
||||
/// </summary>
|
||||
/// <param name="message">要显示的消息内容。</param>
|
||||
/// <param name="duration">消息的显示时长。如果未指定,则使用默认值。</param>
|
||||
void ShowInfo(string message, TimeSpan? duration = null);
|
||||
}
|
||||
Reference in New Issue
Block a user