private void FbLogin() { var fbLogin = new FacebookLoginWindow(); fbLogin.ShowDialog(); var user = fbLogin.User; }
private void tbsShareToFacebook_Click(object sender, RoutedEventArgs e) { //BUG FIX e.Handled = true; var selectedTab = (TabItemViewModel)xtraTabControl1.SelectedItem; if (selectedTab == null) { return; } var obj = selectedTab.EntryObject; if (obj.Status == EntryObjectStatus.Planned) { BAMessageBox.ShowInfo("TrainingDayWindow_ErrShareToFacebook_PlannedEntry".TranslateStrings()); return; } //todo:add code where user hasnt' configured facebook account if (BAMessageBox.AskYesNo("Message_TrainingDayWindow_tbsShareToFacebook_Click".TranslateStrings()) == MessageBoxResult.Yes) { if (string.IsNullOrEmpty(Settings1.Default.FacebookToken)) { FacebookLoginWindow dlg = new FacebookLoginWindow(); if (dlg.ShowDialog() == false) { return; } } SocialNetworkShare share = new SocialNetworkShare(); if (share.PostEntryObject(obj)) { BAMessageBox.ShowInfo(Strings.TrainingDayWindow_MsgFacebokShareCompleted); } else { BAMessageBox.ShowInfo(Strings.TrainingDayWindow_MsgFacebokShareNotImplemented); } } }