-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMessagePage.xaml.cs
45 lines (36 loc) · 1.25 KB
/
MessagePage.xaml.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
using AirshipDotNet;
using AirshipDotNet.MessageCenter.Controls;
namespace MauiSample;
public partial class MessagePage : ContentPage
{
public event EventHandler<MessageLoadStartedEventArgs> LoadStarted;
public event EventHandler<MessageLoadFinishedEventArgs> LoadFinished;
public event EventHandler<MessageLoadFailedEventArgs> LoadFailed;
public event EventHandler<MessageClosedEventArgs> Closed;
public MessagePage()
{
InitializeComponent();
}
public string MessageId
{
get => messageView.MessageId;
set
{
if (value != messageView.MessageId)
{
messageView.MessageId = value;
}
}
}
void MessageView_LoadStarted(object sender, MessageLoadStartedEventArgs args) =>
LoadStarted?.Invoke(this, args);
void MessageView_LoadFailed(object sender, MessageLoadFailedEventArgs args) =>
LoadFailed?.Invoke(this, args);
void MessageView_LoadFinished(object sender, MessageLoadFinishedEventArgs args)
{
LoadFinished?.Invoke(this, args);
Airship.Instance.MarkMessageRead(MessageId);
}
void MessageView_Closed(object sender, MessageClosedEventArgs args) =>
Closed?.Invoke(this, args);
}