コード例 #1
0
        public void ShowHome()
        {
            var currentWindow = Application.Current.Windows.OfType <Window>().SingleOrDefault(x => x.IsActive);

            _homeScreenWindow = new HomeScreenView();
            _homeScreenWindow.Show();
            currentWindow.Close();
        }
コード例 #2
0
        private void HandleLogin()
        {
            //Window was corrupt
            var targetPerson = UOW.Employee.GetAll()
                               .FirstOrDefault(e => e.Wachtwoord == Password && e.Username == Username);

            if (targetPerson == null)
            {
                Console.WriteLine("failed to login");
                MessageBox.Show("Er is iets fout gegaan", "Fout bij invoeren velden",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                //TODO exit main window
                Console.WriteLine("login ok");
                Username = "";
                Password = "";
                RaisePropertyChanged(() => Username);
                RaisePropertyChanged(() => Password);
                HomeScreenView home = new HomeScreenView();
                home.Show();
            }
        }