Notification(String, String, NotificationType, Nullable<TimeSpan>, Action, Action) Constructor
Initializes a new instance of the Notification class.
Definition
Namespace: Avalonia.Controls.Notifications
Assembly: Avalonia.Controls (in Avalonia.Controls.dll)
- C#
- VB
- F#
public Notification(
string? title,
string? message,
NotificationType type = NotificationType.Information,
TimeSpan? expiration = null,
Action? onClick = null,
Action? onClose = null
)
Public Sub New (
title As String,
message As String,
Optional type As NotificationType = NotificationType.Information,
Optional expiration As TimeSpan? = Nothing,
Optional onClick As Action = Nothing,
Optional onClose As Action = Nothing
)
new :
title : string *
message : string *
?type : NotificationType *
?expiration : Nullable<TimeSpan> *
?onClick : Action *
?onClose : Action
(* Defaults:
let _type = defaultArg type NotificationType.Information
let _expiration = defaultArg expiration null
let _onClick = defaultArg onClick null
let _onClose = defaultArg onClose null
*)
-> Notification
Parameters
- String
- The title of the notification.
- String
- The message to be displayed in the notification.
- NotificationType (Optional)
- The NotificationType of the notification.
- Nullable(TimeSpan) (Optional)
- The expiry time at which the notification will close. Use Zero for notifications that will remain open.
- Action (Optional)
- An Action to call when the notification is clicked.
- Action (Optional)
- An Action to call when the notification is closed.
See Also
Reference
Notification Class
Notification Overload
Avalonia.Controls.Notifications Namespace