Table of Contents

ToastMessage 类

命名空间
ClassIsland.Core.Models.UI
程序集
ClassIsland.Core.dll

代表一条 Toast 消息的内容

public class ToastMessage : ObservableRecipient, INotifyPropertyChanged, INotifyPropertyChanging
继承
ToastMessage
实现
继承成员

构造函数

ToastMessage()

初始化一个 ToastMessage 实例。

public ToastMessage()

ToastMessage(string)

初始化一个 ToastMessage 实例。

public ToastMessage(string message)

参数

message string

ToastMessage(string, string)

初始化一个 ToastMessage 实例。

public ToastMessage(string title, string message)

参数

title string
message string

属性

ActionContent

操作按钮内容

public object? ActionContent { get; init; }

属性值

object

AutoClose

消息是否会自动关闭。只有在这个属性为 true 时,Duration属性才会生效。

public bool AutoClose { get; init; }

属性值

bool

CanUserClose

用户是否可以自行关闭此消息

public bool CanUserClose { get; init; }

属性值

bool

Duration

消息持续时间。只有在AutoClose属性为 true 时,这个属性才会生效。

public TimeSpan Duration { get; init; }

属性值

TimeSpan

IsOpen

消息是否被显示

public bool IsOpen { get; }

属性值

bool

Message

消息内容

public string Message { get; init; }

属性值

string

Severity

消息重要程度

public InfoBarSeverity Severity { get; init; }

属性值

InfoBarSeverity

Title

消息标题

public string Title { get; init; }

属性值

string

方法

Close()

结束消息显示。

public void Close()