The XamBarcode™ control exposes the following events:
The ErrorMessageDisplayingEventArgs object’s ErrorMessage property allows you to get or set the error message. 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.
You will handle the DataChanged and ErrorMessageDisplaying events .
Add a XamBarcode control to your page . For more info on this, see Adding Barcode Using XAML Code or Adding Barcode In Code-Behind .
Handle the events :
In XAML:
<ig:XamMaxiCodeBarcode
x:Name="Barcode"
DataChanged="Barcode_DataChanged"
ErrorMessageDisplaying="Barcode_ErrorMessageDisplaying" />
In Visual Basic:
Import Infragistics.Controls.Barcodes
Private Sub Barcode_DataChanged (ByVal sender As System.Object,
ByVal e As DataChangedEventArgs)
Dim errorMessage = e.ErrorMessage
End Sub
Private Sub Barcode_ErrorMessageDisplaying (ByVal sender As System.Object, ByVal e As ErrorMessageDisplayingEventArgs)
Dim newData = e.NewData
End Sub
In C#:
using Infragistics.Controls.Barcodes;
private void Barcode_ErrorMessageDisplaying(object sender,
ErrorMessageDisplayingEventsArgs e) {
string errorMessage = e.ErrorMessage;
}
private void Barcode_DataChanged(object, DataChangedEventArgs e) {
string newData = e.NewData;
}
Save and run your application.
In XAML:
<ig:XamPdf417Barcode
x:Name="Barcode"
Data="xamBarcode"
EncodingMode="Numeric" />
In Visual Basic:
Dim Barcode As New XamPdf417Barcode()
Barcode.Data = "xamBarcode"
Barcode.EncodingMode = CompactionMode.Numeric
In C#:
var Barcode = new XamPdf417Barcode();
Barcode.Data = "xamBarcode";
Barcode.EncodingMode = CompactionMode.Numeric;