You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ConsEco/Sources/IHM/Mobile/ErrorPage.xaml.cs

46 lines
811 B

using Model;
using System.Diagnostics;
namespace IHM.Mobile;
public partial class ErrorPage : ContentPage
{
public Manager Mgr => (App.Current as App).Manager;
public const int TIME_TEST_DB = 15000;
public ErrorPage()
{
InitializeComponent();
startTestConnexion();
}
protected override bool OnBackButtonPressed()
{
return true;
}
public void conIsActive()
{
while (!Mgr.Pers.TestConnexion())
{
Thread.Sleep(TIME_TEST_DB);
}
ConnexionValide();
return;
}
public void startTestConnexion()
{
Task testConnexion = new Task(() => conIsActive());
testConnexion.Start();
}
private async void ConnexionValide()
{
await Navigation.PopModalAsync();
}
}