private void Button_Click(object sender, RoutedEventArgs e) { Database Sql = new Database(); if (Sql.getUserData(BoxLogin.Text, BoxPassword.Password) == null) { LabelError.Visibility = Visibility.Visible; } else { string[] loggedUser = Sql.getUserData(BoxLogin.Text, BoxPassword.Password); UserPanel w2 = new UserPanel(loggedUser); w2.Show(); this.Close(); } }