private void login()
        {
            SPMSViewModel viewModel = new SPMSViewModel();

            // Attempt to extract the user id
            int userId;
            if (!int.TryParse(textBox1.Text, out userId))
            {
                userId = 0; // Not a number
            }
            string password = passwordBox1.Password;

            if (viewModel.AuthenticateUser(userId, password))
            {
                MainWindow main = new MainWindow(viewModel);
                main.Show();
                this.Close();
            }
            else
            {
                MessageBox.Show(
                    "Unable to log in. Please check your username and password and try again.  If the problem persists, please contact your administrator.",
                    "Login Failed",
                    MessageBoxButton.OK,
                    MessageBoxImage.Error);
            }
        }
 public TeamWindow(ViewModel.TeamView team, ViewModel.SPMSViewModel viewModel)
 {
     InitializeComponent();
     _team = team;
     _viewModel = viewModel;
 }
 public MainWindow(SPMSViewModel vm)
 {
     _viewModel = vm;
     InitializeComponent();
     BackgroundColor = Brushes.LightBlue;
 }
 public NewItemWindow(MainWindow.selection type, ViewModel.SPMSViewModel vm)
 {
     InitializeComponent();
     _type = type;
     _viewModel = vm;
 }