Esempio n. 1
0
        private void Demo_Click(object sender, RoutedEventArgs e)
        {
            // Charger des données de demo pour l'application
            RequestViewModel.Instance.LaunchDemo();

            // Masque le dialogue de connection
            ConnectDialog.HideConnectDialog();
        }
Esempio n. 2
0
 public static void ShowConnectDialog()
 {
     WindowWrapper.Current().Dispatcher.Dispatch(() =>
     {
         var modal = Window.Current.Content as ModalDialog;
         var view  = modal.ModalContent as ConnectDialog;
         if (view == null)
         {
             modal.ModalContent = view = new ConnectDialog();
         }
         modal.IsModal = true;
         //view.Logo.Begin();
     });
 }
Esempio n. 3
0
        private async void bConnect_Click(object sender, RoutedEventArgs e)
        {
            // Lance le rapatriement des données de Jeedom
            var taskFactory = new TaskFactory(TaskScheduler.FromCurrentSynchronizationContext());

            await taskFactory.StartNew(async() =>
            {
                // Connection à Jeedom
                var error = await RequestViewModel.Instance.ConnectJeedomByLogin();
                if (error != null)
                {
                    ShowError(error.message); return;
                }

                // Création du mobile dans le plugin
                error = await RequestViewModel.Instance.CreateEqLogicMobile();
                if (error != null)
                {
                    ShowError(error.message); return;
                }

                error = await RequestViewModel.Instance.SearchConfigByKey("jeedom::url", "core");
                if (error != null)
                {
                    ShowError(error.message); return;
                }
                //RequestViewModel.config.HostExt = RequestViewModel.Instance.configByKey;

                await taskFactory.StartNew(async() =>
                {
                    await RequestViewModel.Instance.FirstLaunch();
                });

                // Masque le dialogue de connection
                ConnectDialog.HideConnectDialog();
            });
        }