-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAppShell.xaml.cs
More file actions
49 lines (46 loc) · 1.72 KB
/
AppShell.xaml.cs
File metadata and controls
49 lines (46 loc) · 1.72 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
using BoolBnB_MAUI.Pages.CreateUpdateHouse;
using BoolBnB_MAUI.Pages.Home;
using BoolBnB_MAUI.Pages.Homes;
using BoolBnB_MAUI.Pages.Info;
using BoolBnB_MAUI.Pages.Login;
using BoolBnB_MAUI.Pages.MyHouses;
using BoolBnB_MAUI.Pages.MyHouse;
using BoolBnB_MAUI.Pages.Settings;
using BoolBnB_MAUI.Pages.Messages;
using BoolBnB_MAUI.Services;
namespace BoolBnB_MAUI
{
public partial class AppShell : Shell
{
protected readonly AuthService _authService;
public AppShell()
{
InitializeComponent();
_authService = new AuthService();
App.Current.UserAppTheme = AppTheme.Light;
Routing.RegisterRoute(nameof(HomesPage), typeof(HomesPage));
Routing.RegisterRoute(nameof(HomePage), typeof(HomePage));
Routing.RegisterRoute(nameof(LoginPage), typeof(LoginPage));
Routing.RegisterRoute(nameof(CreateUpdateHousePage), typeof(CreateUpdateHousePage));
Routing.RegisterRoute(nameof(InfoPage), typeof(InfoPage));
Routing.RegisterRoute(nameof(MyHousesPage), typeof(MyHousesPage));
Routing.RegisterRoute(nameof(MyHousePage), typeof(MyHousePage));
Routing.RegisterRoute(nameof(SettingsPage), typeof(SettingsPage));
Routing.RegisterRoute(nameof(MessagesPage), typeof(MessagesPage));
}
private async void Logout(object sender, EventArgs e)
{
var token = await _authService.GetToken();
var isLogout = await _authService.Logout(token);
if (isLogout)
{
//
await Current.GoToAsync($"//{nameof(HomesPage)}");
}
else
{
//
}
}
}
}