Files
SunlightAggregationTerminal/AppShell.xaml.cs
T

44 lines
1.2 KiB
C#
Raw Normal View History

2026-05-01 14:44:49 +08:00
using SunlightAggregationTerminal.Class;
using SunlightAggregationTerminal.Models;
using SunlightAggregationTerminal.View;
namespace SunlightAggregationTerminal
{
public partial class AppShell : Shell
{
public AppShell()
{
InitializeComponent();
this.BindingContext = new AppModels();
}
2026-05-02 12:52:31 +08:00
private async void Shell_Loaded(object sender, EventArgs e)
2026-05-01 14:44:49 +08:00
{
//打开登录
if (!App.GlobalData.LogNo)
{
var logpage = new View.LogPage();
2026-05-02 12:52:31 +08:00
await Navigation.PushModalAsync(new NavigationPage(logpage));
2026-05-01 14:44:49 +08:00
}
else
{
var loading = new View.Loading();
await Navigation.PushModalAsync(loading);
2026-05-03 22:17:25 +08:00
2026-05-02 12:52:31 +08:00
if (await AppModels.LogIn())
{
await loading.Navigation.PopModalAsync();
}
else
{//拒绝登陆时打开登录页面
await loading.Navigation.PopModalAsync();
2026-05-01 14:44:49 +08:00
var logpage = new View.LogPage();
await Navigation.PushModalAsync(new NavigationPage(logpage));
2026-05-02 12:52:31 +08:00
}
2026-05-01 14:44:49 +08:00
}
}
}
}