Version

Handling Events

Before You Begin

The XamBarcode™ control exposes the following events:

The DataChangedEventArgs object’s NewData property conveniently allows you to get the value of the XamBarcode control’s Data property that has just been changed.

What You Will Accomplish

You will handle the DataChanged event.

Follow these Steps

  1. Add a XamBarcode control to your application . For more info on this, see Adding Barcode Using XAML Code or Adding Barcode In Code-Behind .

  2. Handle the event:

In XAML:

<ig:XamQRCodeBarcode x:Name="Barcode" DataChanged="Barcode_DataChanged"/>

In C#:

using Infragistics.XamarinForms.Controls.Barcodes;
using Infragistics.Controls.Barcodes.Implementation;

private void Barcode_DataChanged(object sender, DataChangedEventArgs e)
{
    string newData = e.NewData;
}
  1. Save and run your application.

Default Error Message

In XAML:

<ig:XamQRCodeBarcode x:Name="Barcode" Data="xamBarcode" EncodingMode="Numeric" />

In C#:

var barcode = new XamQRCodeBarcode
{
    Data = "xamBarcode",
    EncodingMode = EncodingMode.Numeric,
};
barcode dataError.png