Ejemplo n.º 1
0
        partial void TwitterLoginButton_TouchUpInside(UIButton sender)
        {
            TwitterConnectedImage.Image = UIImage.FromBundle("loading-indicator");
            Platform.AnimateRotation(TwitterConnectedImage);

            var auth           = new TwitterAuthentificator("QkS2cTMjtUD1F8N7NvA9w", "NVaB0TL4CmyWlFl0mXoTv9S5LncEdQx2uh2wkP7DsOo", Configuration.Scope, this);
            var authenticator  = auth.GetAuthenticator();
            var viewController = authenticator.GetUI();

            PresentViewController(viewController, true, null);
        }
Ejemplo n.º 2
0
 public override void OnViewModelChanged(object sender, PropertyChangedEventArgs e)
 {
     base.OnViewModelChanged(sender, e);
     if (e.PropertyName == PropertiesExtension.GetPropertyName(() => ViewModel.FBLoaderImage))
     {
         if (ViewModel.IsBusy)
         {
             AnimateImage(twitterNetworkLoader);
             var auth          = new FacebookAuthenticator(Configuration.FbClientId, Configuration.Scope, ViewModel);
             var authenticator = auth.GetAuthenticator();
             var intent        = authenticator.GetUI(this.Activity);
             this.StartActivity(intent);
             AnimateImage(fbNetworkLoader);
         }
         if (!ViewModel.IsBusy)
         {
             fbNetworkLoader.ClearAnimation();
         }
         ChangeSocialNetworkTextColor();
     }
     if (e.PropertyName == PropertiesExtension.GetPropertyName(() => ViewModel.TwitterLoaderImage))
     {
         if (ViewModel.IsBusy)
         {
             var auth          = new TwitterAuthentificator(Configuration.ConsumerKeyTwitter, Configuration.ConsumerSecretTwitter, Configuration.Scope, ViewModel);
             var authenticator = auth.GetAuthenticator();
             var intent        = authenticator.GetUI(this.Activity);
             this.StartActivity(intent);
             AnimateImage(twitterNetworkLoader);
         }
         if (!ViewModel.IsBusy)
         {
             twitterNetworkLoader.ClearAnimation();
         }
         ChangeSocialNetworkTextColor();
     }
     if (e.PropertyName == PropertiesExtension.GetPropertyName(() => ViewModel.InstaLoaderImage))
     {
         if (ViewModel.IsBusy)
         {
             var auth          = new InstagramAuthenticator(Configuration.ConsumerKeyInsta, string.Empty, Configuration.InstaScope, ViewModel);
             var authenticator = auth.GetAuthenticator();
             var intent        = authenticator.GetUI(this.Activity);
             this.StartActivity(intent);
             AnimateImage(instaNetworkLoader);
         }
         if (!ViewModel.IsBusy)
         {
             instaNetworkLoader.ClearAnimation();
         }
         ChangeSocialNetworkTextColor();
     }
 }