public override void ViewDidLoad()
 {
     base.ViewDidLoad ();
     homePage = Element as HomePage;
     this.Environment = PayPalPaymentDelegate.PayPalEnvironmentNoNetwork;
     homePage.BuyAnItem.Clicked += BuyAnItemClicked;
 }
        protected override void OnElementChanged(ElementChangedEventArgs<Page> e)
        {
            base.OnElementChanged (e);

            if (e.OldElement != null) {
                homePage = e.NewElement as HomePage;
                homePage.BuyAnItem.Clicked -= OnBuyAnItem;
            }
            if (e.NewElement is HomePage) {
                homePage = e.NewElement as HomePage;
                homePage.BuyAnItem.Clicked += OnBuyAnItem;
                config = new PayPalConfiguration ();
                config.ClientId (AppConfig.kPayPalClientId);
            }
        }