| | | 1 | | // ----------------------------------------------------------------------- |
| | | 2 | | // <copyright file="Toast.cs" company="Stéphane ANDRE"> |
| | | 3 | | // Copyright (c) Stéphane ANDRE. All rights reserved. |
| | | 4 | | // </copyright> |
| | | 5 | | // ----------------------------------------------------------------------- |
| | | 6 | | |
| | | 7 | | using System.Windows.Input; |
| | | 8 | | using MyNet.UI.Notifications.Models; |
| | | 9 | | using MyNet.UI.Toasting.Settings; |
| | | 10 | | |
| | | 11 | | namespace MyNet.UI.Toasting.Models; |
| | | 12 | | |
| | | 13 | | /// <summary> |
| | | 14 | | /// Default immutable toast implementation used by the built-in toast factory. |
| | | 15 | | /// </summary> |
| | | 16 | | public sealed class Toast( |
| | | 17 | | INotification notification, |
| | | 18 | | ToastSettings? settings = null, |
| | | 19 | | ICommand? clickCommand = null, |
| | | 20 | | ICommand? closeCommand = null) : IToast |
| | | 21 | | { |
| | | 22 | | /// <inheritdoc /> |
| | | 23 | | public INotification Notification { get; } = notification; |
| | | 24 | | |
| | | 25 | | /// <inheritdoc /> |
| | 30 | 26 | | public ToastSettings Settings { get; } = settings ?? ToastSettings.Default; |
| | | 27 | | |
| | | 28 | | /// <inheritdoc /> |
| | | 29 | | public bool IsVisible { get; } = true; |
| | | 30 | | |
| | | 31 | | /// <inheritdoc /> |
| | | 32 | | public ICommand? ClickCommand { get; } = clickCommand; |
| | | 33 | | |
| | | 34 | | /// <inheritdoc /> |
| | | 35 | | public ICommand? CloseCommand { get; } = closeCommand; |
| | | 36 | | } |
| | | 37 | | |