Пример #1
0
        public StartPage()
        {
            RenderContent();

            btnScanCreditCard.Clicked += (sender, args) =>
            {
                CardIOConfig cardIOConfig = new CardIOConfig();
                var          ccPage       = new CreditCardEntryPage(cardIOConfig);

                // Not really called - Can't get reference to the CreditCardEntryPage right in Android.
                ccPage.ScanCancelled += HandleScanCancelled;
                ccPage.ScanSucceeded += HandleScanSucceeded;

                Navigation.PushModalAsync(ccPage);
            };

            MessagingCenter.Subscribe <CreditCard_PCL> (this, "CreditCardScanSuccess", (sender) => {
                // Do something whenever the "iOSCreditCardReceived" message is sent.
                // We could fill in CCV and expiration date things here, whatever else we need.
                // This is enough to show capability, however.
                txtCreditCardNumber.Text = sender.redactedCardNumber;
                Navigation.PopModalAsync();
            });

            MessagingCenter.Subscribe <CreditCard_PCL> (this, "CreditCardScanCancelled", (sender) => {
                // Do something whenever the "CreditCardCancelled" message is sent.
                Navigation.PopModalAsync();
            });
        }
 public CreditCardEntryPage(CardIOConfig config)
 {
     cardIOConfig = config;
 }