Version

Adding Barcode Using XAML Code

Before You Begin

This topic is designed to get you up and running as quickly as possible by describing the basic steps required for adding a XamCode128Barcode™ control to your application using XAML.

What You Will Accomplish

You will add a basic XamCode128Barcode™ control to your application.

Follow these Steps

  1. Create a WPF application.

  2. Add the following NuGet package references to your project:

    • Infragistics.WPF.Barcodes

    For more information on setting up the NuGet feed and adding NuGet packages, you can take a look at the following documentation: NuGet Feeds.

  1. Add an XML namespace declaration for XamCode128Barcode :

In XAML:

xmlns:ig="http://schemas.infragistics.com/xaml"
  1. Choose a barcode symbology, and add an instance to the Grid named LayoutRoot.

Note: Each barcode symbology is a separate control.

Supported Symbology Types:

In XAML:

<Grid x:Name="LayoutRoot">
    <ig:XamCode128Barcode x:Name="Barcode" />
</Grid>
  1. Assign a value to the control’s Data property

In XAML:

<ig:XamCode128Barcode x:Name="Barcode" Data="Code128" />
  1. Save and run your application.

xamBarcode Adding Code128 01.png