-
Notifications
You must be signed in to change notification settings - Fork 3.4k
/
SnackbarMessageQueueItem.cs
54 lines (46 loc) · 1.68 KB
/
SnackbarMessageQueueItem.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
using System;
namespace MaterialDesignThemes.Wpf
{
internal class SnackbarMessageQueueItem
{
public SnackbarMessageQueueItem(object content, TimeSpan duration, object actionContent = null, Action<object> actionHandler = null, object actionArgument = null,
bool isPromoted = false, bool ignoreDuplicate = false)
{
Content = content;
Duration = duration;
ActionContent = actionContent;
ActionHandler = actionHandler;
ActionArgument = actionArgument;
IsPromoted = isPromoted;
IgnoreDuplicate = ignoreDuplicate;
}
/// <summary>
/// The content to be displayed
/// </summary>
public object Content { get; }
/// <summary>
/// Message show duration.
/// </summary>
public TimeSpan Duration { get; }
/// <summary>
/// The content for the action button on the snackbar
/// </summary>
public object ActionContent { get; }
/// <summary>
/// Handler to be invoked when the action button is clicked
/// </summary>
public Action<object> ActionHandler { get; }
/// <summary>
/// The argument to pass to the <see cref="ActionHandler"/> delegate.
/// </summary>
public object ActionArgument { get; }
/// <summary>
/// Promote the message, pushing it in front of any message that is not promoted.
/// </summary>
public bool IsPromoted { get; }
/// <summary>
/// Still display this message even if it is a duplicate.
/// </summary>
public bool IgnoreDuplicate { get; }
}
}