public async Task LogIn() { try { ErrorMessage = ""; authenticatedUser = null; authenticatedUser = await apiClient.AuthenticateUser(Username, Password); MessageBoxColor = Brushes.Green; ErrorMessage = "Logged properly"; LoggedSuccessfully(this, null); } catch (Exception ex) { MessageBoxColor = Brushes.Red; ErrorMessage = ex.Message; } }