title: Generate barcode using Zxing in xamarin.forms
body: <p>I am trying to display a barcode in my app using binding in my xaml. My question  is how can I convert the barcode to be used in the xaml Image source. I have tried using a byte property but I get this compile error : <strong>"Cannot implicitly convert Zxing barcode image view to 'byte'"</strong>. Any guidance on how to achieve this will be appreciate, thanks.</p>
  
  <p><strong>Cards.cs</strong></p>
  
  <pre><code> public class Cards
      {
          public int CustomerID { get; set; }
          public int DiscountLevelID { get; set; }
          public string DiscountLevel { get; set; }
          public double DiscountLevelAmount { get; set; }
          public bool StoreCustomerGiftCard { get; set; }
          public bool StoreCustomerLoyalty { get; set; }
          public int LoyaltyLevelID { get; set; }
          public string LoyaltyLevel { get; set; }
          public double LoyaltyLevelRatio { get; set; }
          public double Balance { get; set; }
          public int StoreNumber { get; set; }
          public string CardNumber { get; set; }
          public bool IsError { get; set; }
          public object ErrorMessage { get; set; }
          public string CompanyName { get; set; }
          public string CustomerLogo { get; set; }
          public byte BarCode { get; set; }
  
      }
  </code></pre>
  
  <p><strong>Cards.xaml.cs</strong></p>
  
  <pre><code>ZXingBarcodeImageView barcode;
  
   barcode = new ZXingBarcodeImageView { HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand };
                          barcode.BarcodeFormat = ZXing.BarcodeFormat.QR_CODE;
                          barcode.BarcodeOptions.Width = 300;
                          barcode.BarcodeOptions.Height = 300;
                          barcode.BarcodeOptions.Margin = 10;
                          barcode.BarcodeValue = i.CardNumber;
  
                          i.BarCode = barcode;
  </code></pre>
  
  <p><strong>Cards.xaml</strong></p>
  
  <pre><code>&lt;Image Source="{Binding BarCode}" /&gt;
  </code></pre>