Example #1
0
 protected async override void OnNavigatedTo(NavigationEventArgs e)
 {
     try
     {
         await nfcListener.AttachReader(OnCardReceived);
     }
     catch (Exception ex)
     {
         Debug.WriteLine($"NFC: Cannot read cards: {ex.Message}");
     }
     base.OnNavigatedTo(e);
 }
Example #2
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            // Clear the messages
            MainPage.Current.NotifyUser(String.Empty, NotifyType.StatusMessage, true);
            if (!canReadCards)
            {
                canReadCards = await nfcListener.AttachReader(OnCardReceived);
            }

            if (!canReadCards)
            {
                MainPage.Current.NotifyUser("Did not find an NFC device", NotifyType.ErrorMessage, true);
            }
        }