private void DoWork()
        {
            try
            {
                if (viewModel.CreateDataBase())
                {
                    Application.Current.Dispatcher.BeginInvoke(new Action(() =>
                    {
                        Login view = new Login();
                        view.Show();
                        Close();
                    }));
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 2
0
 private void Application_Startup(object sender, StartupEventArgs e)
 {
     try
     {
         ApplicationViewModel viewModel = new ApplicationViewModel();
         if (viewModel.IsFirstApp)
         {
             CreateDataBaseView view = new CreateDataBaseView();
             view.Init(viewModel);
             view.ShowDialog();
             //Thread.Sleep(1000);
         }
         else
         {
             Login main = new Login();
             main.ShowDialog();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
 //void TimerNuevo_Tick(object sender, EventArgs e)
 //{
 //    npmv = new NuevoPuntoMedicion();
 //    npmv.txbTitulo.Text = "Nueva Captura";
 //    npmv.Owner = this;
 //    npmv.ShowDialog();
 //}
 void vm_PropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     if (e.PropertyName == "Usuario")
     {
         if (vm.Usuario == null)
         {
             Login l = new Login();
             l.Show();
             this.Close();
         }
     }
 }
Exemplo n.º 4
0
 void vmMain_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
 {
     if (e.PropertyName == "Usuario")
     {
         if (vmMain.Usuario == null)
         {
             Login l = new Login();
             l.Show();
             this.Close();
         }
     }
 }