-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainPage.xaml.cs
More file actions
49 lines (44 loc) · 1.54 KB
/
MainPage.xaml.cs
File metadata and controls
49 lines (44 loc) · 1.54 KB
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
namespace WinRT_API_LocalNotification
{
public partial class MainPage : ContentPage
{
int count = 0;
public MainPage()
{
InitializeComponent();
}
//private void OnCounterClicked(object? sender, EventArgs e)
//{
// count++;
// if (count == 1)
// CounterBtn.Text = $"Clicked {count} time";
// else
// CounterBtn.Text = $"Clicked {count} times";
// SemanticScreenReader.Announce(CounterBtn.Text);
//}
private void OnNotificationClicked(object? sender, EventArgs e)
{
#if WINDOWS
WinRT_API_LocalNotification.Platforms.Windows.LocalNotification.Schedule(
"Reminder",
NotesEditor.Text,
DateTime.Now.AddMinutes(1));
#endif
NotesEditor.IsVisible = false;
LabelEditor.FontSize = 20;
LabelEditor.TextColor = Colors.Green;
LabelEditor.Text = "Notification scheduled for 1 minute from now. Please close now the app.";
NotificationBtn.IsVisible = false;
}
// protected override void OnAppearing()
// {
// base.OnAppearing();
//#if WINDOWS
// WinRT_API_LocalNotification.Platforms.Windows.LocalNotification.Schedule(
// "Reminder",
// "Time for a coffee break!",
// DateTime.Now.AddMinutes(1));
//#endif
// }
}
}