-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAppShell.xaml.cs
42 lines (38 loc) · 1.21 KB
/
AppShell.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
using CommunityToolkit.Maui.Views;
using YTDownloaderMAUI.Pages;
using YTDownloaderMAUI.Services;
using YTDownloaderMAUI.Views;
namespace YTDownloaderMAUI
{
public partial class AppShell : Shell
{
public AppShell()
{
InitializeComponent();
Routing.RegisterRoute("SettingsPage", typeof(SettingsPage));
Routing.RegisterRoute("TestPage", typeof(TestPage));
}
private async void OnSettingsButtonClicked(object sender, EventArgs e)
{
await Shell.Current.GoToAsync("SettingsPage");
}
private async void AppMenuExitButton_Clicked(object sender, EventArgs e)
{
var popup = new YTPopup("Exit YT Downloader", "All your download entries will be deleted!\n\nDo you really want to exit?", "Confirm", "Decline");
var result = await this.ShowPopupAsync(popup);
if (result is bool boolResult)
{
if (boolResult)
{
#if ANDROID
Android.OS.Process.KillProcess(Android.OS.Process.MyPid());
#endif
}
else
{
return;
}
}
}
}
}