Exemplo n.º 1
0
        // Attente de la validation du lient entre le miroir et l'application par l'API
        private async void WaitForLink()
        {
            while (true)
            {
                Tuple <bool, string> status = await APIManager.GetIsLinked(DataAccess.GetMiror().Id);

                if (status.Item1 && !string.IsNullOrEmpty(status.Item2))
                {
                    //BackHomePanel.Visibility = Visibility.Visible;
                    LinkDone.Visibility = Visibility.Visible;
                    Miror miror = DataAccess.GetMiror();
                    miror.Usermail = status.Item2;
                    miror.IsPaired = true;
                    DataAccess.UpdateEntity(miror);
                    GlobalStatusManager.Instance.GlobalStatus = EGlobalStatus.Paired;
                    await UserManager.Instance.Init();

                    await Task.Delay(2000);

                    break;
                }
                await Task.Delay(2000);

                //id = "5b8f";
                //TODO : Appel API popur savoir si on est pair a un compte
                //await Task.Delay(1000);
            }
            Classes.FrameManager.GoTo(Classes.FrameManager.LockPageFrame);
        }