private void LogIn(object sender, RoutedEventArgs eventLog) { if (ValidateCredential()) { string email = tbEmail.Text; string password = Security.Encrypt(pbPassword.Password); try { InstanceContext instanceContext = new InstanceContext(this); PlayerManagerClient logIn = new PlayerManagerClient(instanceContext); logIn.LogIn(email, password); if (responseGeneral) { tbEmail.BorderBrush = Brushes.LightGreen; pbPassword.BorderBrush = Brushes.LightGreen; Lobby lobby = new Lobby(); lobby.EmailReceived(email); lobby.ColocateBestScores(); lobby.ColocatePersonalInformation(); lobby.Show(); this.Close(); } else { WrongCredentials(); } } catch (EndpointNotFoundException exception) { TelegramBot.SendToTelegram(exception); LogException.Log(this, exception); LogException.ErrorConnectionService(); } } }