我正在尝试在 Windows Store 应用程序中使用 zxing Barcode 库来生成条形码图像。不显示图像。以下有什么问题?
查看型号:
public BarcodeViewModel(INavigationService navigationservice, IDataService dataservice) : base(navigationservice, dataservice)
{
var bh = new BarcodeHelper();
BarcodeImage = new Image() {Source = bh.GetBarcode("123123")};
}
public Image BarcodeImage { get { return barcodeimage; } set { barcodeimage = value; NotifyOfPropertyChange(() => BarcodeImage); } }
看法:
<Image Source="{Binding BarcodeImage}"/>
条码类:
public WriteableBitmap GetBarcode(string barcodetext)
{
IBarcodeWriter writer = new BarcodeWriter { Format = BarcodeFormat.CODE_128 };
var result = writer.Write(barcodetext);
return result;
}