private void OnSessionStateChanged(object sender, SessionStateChangedEventArgs e)
 {
     if (e.SessionState == FacebookSessionState.Opened)
     {
         Frame.Navigate(typeof(FacebookAuthentication), Session.ActiveSession.CurrentAccessTokenData);
     }
 }
Пример #2
0
 private void OnSessionStateChanged(object sender, Facebook.Client.Controls.SessionStateChangedEventArgs e)
 {
     this.welcomeText.Opacity             = (e.SessionState == FacebookSessionState.Opened) ? 0 : 100;
     this.ContentPanel.Opacity            = (e.SessionState == FacebookSessionState.Opened) ? 100 : 0;
     this.userInfo.Visibility             = Visibility.Collapsed;
     this.placePickerScenario.Visibility  = Visibility.Collapsed;
     this.friendPickerScenario.Visibility = Visibility.Collapsed;
     this.placePickerScenario.Visibility  = Visibility.Collapsed;
 }
Пример #3
0
        private void loginButton_SessionStateChanged(object sender, Facebook.Client.Controls.SessionStateChangedEventArgs e)
        {
            Facebook.Client.Controls.LoginButton x = (Facebook.Client.Controls.LoginButton)sender;
            if (e.SessionState == Facebook.Client.Controls.FacebookSessionState.Opened)
            {
                App.CurrentSession  = x.CurrentSession;
                App.AccessToken     = x.CurrentSession.AccessToken;
                App.FacebookId      = x.CurrentSession.FacebookId;
                App.CurrentUser     = x.CurrentUser;
                App.isAuthenticated = true;
                Frame.Navigate(typeof(MainPage));
            }
            else if (e.SessionState == Facebook.Client.Controls.FacebookSessionState.Closed)
            {
                App.CurrentSession = null;

                // The control signals when user info is set (handled in OnUserInfoChanged below), but not when it
                // is cleared (probably a bug), so we clear our reference here when the session ends.
                App.CurrentUser = null;
            }
        }
 private void OnSessionStateChanged(object sender, Facebook.Client.Controls.SessionStateChangedEventArgs e)
 {
     this.welcomeText.Opacity  = (e.SessionState == FacebookSessionState.Opened) ? 0 : 100;
     this.contentPanel.Opacity = (e.SessionState == FacebookSessionState.Opened) ? 100 : 0;
 }