private void StartInspection_Click(object sender, RoutedEventArgs e) { string password = Password.Password.ToString(); mUser user = (from c in db.mUsers where c.UserID == UserName.Text && c.Password == password select c).FirstOrDefault(); if (user != null) { Home InspectItem = new Home(user); InspectItem.Show(); this.Close(); invalid.Visibility = Visibility.Hidden; } else { invalid.Visibility = Visibility.Visible; } }
public Home(mUser user) { currentUser = user; InitializeComponent(); }