Class NotificationBuilder
Represents a builder that can be used to create notifications.
public class NotificationBuilder
- Inheritance
-
objectNotificationBuilder
Constructors
NotificationBuilder(Window)
Creates a new instance of the NotificationBuilder class.
public NotificationBuilder(Window parent)
Parameters
parentWindowThe parent window that will host the notification.
Methods
HavingButton(Action<NotificationButtonBuilder>)
Changes the action button of the notification.
public NotificationBuilder HavingButton(Action<NotificationButtonBuilder> configure)
Parameters
configureAction<NotificationButtonBuilder>An action to configure the button.
Returns
- NotificationBuilder
The notification builder that can be used to further build the notification.
Show()
Shows the notification.
public Action Show()
Returns
- Action
An action that can be called to hide the notification.
Exceptions
WithHorizontalPosition(HorizontalAlignment)
Changes the horizontal position of the notification inside the parent window.
public NotificationBuilder WithHorizontalPosition(HorizontalAlignment position)
Parameters
positionHorizontalAlignmentThe horizontal position of the notification inside the parent window.
Returns
- NotificationBuilder
The notification builder that can be used to further build the notification.
WithMessage(string?)
Changes the message of the notification.
public NotificationBuilder WithMessage(string? content)
Parameters
contentstringThe new message.
Returns
- NotificationBuilder
The notification builder that can be used to further build the notification.
WithSeverity(NotificationSeverity)
Changes the severity (color) of the notification.
public NotificationBuilder WithSeverity(NotificationSeverity severity)
Parameters
severityNotificationSeverityThe severity (color) of the notification.
Returns
- NotificationBuilder
The notification builder that can be used to further build the notification.
WithTimeout(TimeSpan)
Changes the timeout of the notification after which it disappears automatically.
public NotificationBuilder WithTimeout(TimeSpan timeout)
Parameters
timeoutTimeSpanThe timeout of the notification after which it disappears automatically.
Returns
- NotificationBuilder
The notification builder that can be used to further build the notification.
WithTitle(string?)
Changes the title of the notification.
public NotificationBuilder WithTitle(string? title)
Parameters
titlestringThe new title.
Returns
- NotificationBuilder
The notification builder that can be used to further build the notification.
WithVerticalPosition(VerticalAlignment)
Changes the vertical position of the notification inside the parent window.
public NotificationBuilder WithVerticalPosition(VerticalAlignment position)
Parameters
positionVerticalAlignmentThe vertical position of the notification inside the parent window.
Returns
- NotificationBuilder
The notification builder that can be used to further build the notification.