public void LogInAction(string user, string pwd)
 {
     if (model.Login(user, pwd))
     {
         //((Window)LoginView).Hide();
         viewHandler.Hide(LoginView);
         if (MainView == null)
         {
             MainView = container.GetMainView();
         }
         //((Window)MainView).Show();
         viewHandler.Show(MainView);
         Error = "";
     }
     else
     {
         if (!viewHandler.IsReady(ErrorView)) //ErrorView == null || !((Window)ErrorView).IsVisible)
         {
             ErrorView = container.GetLoginErrorView();
         }
         Error = "Invalid login";
         ErrorView.UpdateView();
         //((Window)ErrorView).ShowDialog();
         viewHandler.ShowModal(ErrorView);
     }
 }
        public void LoginAction(string userName, string password)
        {
            if (model.Login(userName, password))
            {
                //hide login
                var loginView = container.Get <IView>("Login");
                viewHandler.Hide(loginView);

                if (!viewHandler.IsReady(mainView))
                {
                    mainView = container.Get <IView>("Main");
                    viewHandler.Show(mainView);
                }
            }
            else
            {
                //show error
                container.Get <IView>("Error").UpdateView();
            }
        }