private async void Window_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e) { if (e.Key == Key.Enter) { check_user = new ZSklad.Context(txtBox.Text, lblPasswordBox.Password); bool check_credentials = await check_user.CheckCredentials(); this.DialogResult = true; //this.Close(); } }
private async void btPassword_Click(object sender, RoutedEventArgs e) { ZSklad.Context check_user = new ZSklad.Context(txtBox.Text, lblPasswordBox.Password); bool check_credentials = await check_user.CheckCredentials(); if (check_credentials) { this.DialogResult = true; this.Close(); } else { MessageBox.Show("přihlášení selhalo"); } }
public MainWindow(ZSklad.Context context) { ctx = context; InitializeComponent(); }