Beispiel #1
0
        public override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            if (e.Parameter is Session)
            {
                var session = e.Parameter as Session;
                if (session != null)
                {
                    switch (session.Provider)
                    {
                    case Constants.FacebookProvider:
                        FacebookAccessToken = session.AccessToken;
                        break;

                    case Constants.GoogleProvider:
                        GoogleAccessToken = session.AccessToken;
                        break;

                    case Constants.MicrosoftProvider:
                        MicrosoftAccessToken = session.AccessToken;
                        break;
                    }
                }
            }

            try
            {
                sessions = applicationSettings.LoadCredential();

                foreach (var session in sessions)
                {
                    switch (session.Provider)
                    {
                    case Constants.FacebookProvider:
                        FacebookAccessToken = session.AccessToken;
                        break;

                    case Constants.GoogleProvider:
                        GoogleAccessToken = session.AccessToken;
                        break;

                    case Constants.MicrosoftProvider:
                        MicrosoftAccessToken = session.AccessToken;
                        break;
                    }
                }
            }
            catch (Exception)
            {
            }
        }