private void ConnexionButton_Click(object sender, RoutedEventArgs e) { /* Try to connect user to Mojang account */ if (true == Authenticator.AuthenticateToMinecraft(UserName.Text, PassWord.Password)) { StatusText.Visibility = Visibility.Collapsed; LauncherMainMenu launcherMainMenu = new LauncherMainMenu(); launcherMainMenu.Show(); Close(); } else { StatusText.Visibility = Visibility.Visible; Task.Delay(2000).ContinueWith(_ => { Dispatcher.Invoke(() => { StatusText.Visibility = Visibility.Hidden; }); }); } }