private async void xLogin_Click(object sender, RoutedEventArgs e) { var token = xToken.Password; if (await GitManager.Initialize(token)) { _onLogin(this); } else { string reason = "Invalid token"; if (!Network.IsAvailable) { reason = "Network not available"; } MessageBox.Show($"Can't login on GitHub.\n{reason}", MainWindow.MainTitle, MessageBoxButton.OK, MessageBoxImage.Error); } }