async void tileFacebook_Tapped(object sender, TappedRoutedEventArgs e) { if (App.isAuthenticated) { MessageBoxResult result = await MessageBox.ShowAsync("You're already logged in. Do you want to sign out of this account?. If yes, press Sign Out. Or press Cancel to return to the main menu", "SmartGuard Account", MessageBoxButton.SignOutCancel); if (result == MessageBoxResult.SignOut) { App.isAuthenticated = false; FacebookMethods.LogOut(); txtProfileName.Text = string.Empty; imgProfilPicture.Source = null; } } else { await FacebookMethods.LogIn(); } CheckAuthentication(); }
async void TileFacebook_Tap(object sender, GestureEventArgs e) { if (App.isAuthenticated) { MessageBoxResult result = MessageBox.Show( AppResources.Facebook_LogOut_Question, AppResources.ApplicationTitle, MessageBoxButton.OKCancel); if (result == MessageBoxResult.OK) { App.isAuthenticated = false; FacebookMethods.LogOut(); } } else { string result = await FacebookMethods.LogIn(); if (result == "OK") { MessageBox.Show(AppResources.Facebook_LogIn_Success, AppResources.ApplicationTitle, MessageBoxButton.OK); } else { MessageBox.Show(AppResources.Facebook_LogIn_Error, AppResources.ApplicationTitle, MessageBoxButton.OK); } } CheckAuthentication(); }