I'm looking at the sample for ZXing.net for Xamarin.Forms and it's using a code only approach to creating the barcode.
Since I'm using PRISM, with a backing ViewModel, I'm not entirely sure how to convert the following code into Xaml, so that I can place a label, or other text next to the object.
public class BarcodePage : ContentPage
{
ZXingBarcodeImageView barcode;
public BarcodePage ()
{
barcode = new ZXingBarcodeImageView {
HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand,
AutomationId = "zxingBarcodeImageView",
};
barcode.BarcodeFormat = ZXing.BarcodeFormat.QR_CODE;
barcode.BarcodeOptions.Width = 300;
barcode.BarcodeOptions.Height = 300;
barcode.BarcodeOptions.Margin = 10;
barcode.BarcodeValue = "ZXing.Net.Mobile";
Content = barcode;
}
}
My question is, how do I design a page so that I can place the ImageView