-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAppShell.xaml.cs
33 lines (28 loc) · 1013 Bytes
/
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
using ParonApp.Views;
using System.Windows.Input;
namespace ParonApp;
public partial class AppShell : Shell
{
public Dictionary<string, Type> Routes { get; private set; } = new Dictionary<string, Type>();
public ICommand HelpCommand => new Command<string>(async (url) => await Launcher.OpenAsync(url));
public AppShell()
{
InitializeComponent();
RegisterRoutes();
BindingContext = this;
if (Preferences.Default.Get("loggedIn", false)) ParonAppShell.CurrentItem = homePage;
else ParonAppShell.CurrentItem = loginPage;
}
void RegisterRoutes()
{
Routes.Add("mainPage", typeof(MainPage));
Routes.Add("feedPage", typeof(FeedPage));
Routes.Add("settingsPage", typeof(SettingsPage));
Routes.Add("loginPage", typeof(LoginPage));
Routes.Add("attendancePage", typeof(AttendancePage));
foreach (var item in Routes)
{
Routing.RegisterRoute(item.Key, item.Value);
}
}
}