Xamarin.Forms Android Binding Issues
See original GitHub issueI have just created a two page MVVM solution using Prism. The MainPage has a single button that navigates to a BarcodePage. The BarcodePage only contains the Barcode, but the back navigation is available in the status bar. The BarCodeValue is bound to a string on the view model.
When I navigate back from the BarcodePage to the MainPage in Android I get a SystemArgumentException: Found Empty Contents. When I hard code a value for BarCodeValue within the xaml everything works, and there is no problem in iOS.
I have the following NuGets installed: Xamarin.Forms v3.1.0.637273 ZXing.Net.Mobile v2.4.1 ZXing.Net.Mobile.Forms v2.4.1 Xamarin.Android.Support packages all v25.4.0.2 Prism.Dryloc.Forms v7.0.0.396
I believe the call stack for the error looks like this:
QRCodeWriter.encode (System.String contents, ZXing.BarcodeFormat format, System.Int32 width, System.Int32 height, System.Collections.Generic.IDictionary`2[TKey,TValue] hints)
MultiFormatWriter.encode (System.String contents, ZXing.BarcodeFormat format, System.Int32 width, System.Int32 height, System.Collections.Generic.IDictionary`2[TKey,TValue] hints)
BarcodeWriterGeneric.Encode (System.String contents)
BarcodeWriter`1[TOutput].Write (System.String contents)
ZXingBarcodeImageViewRenderer+<>c__DisplayClass5_0.<regenerate>b__0 ()
Thread+RunnableImplementor.Run ()
Any help would be greatly appreciated.
Thanks,
Andrew
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (1 by maintainers)

Top Related StackOverflow Question
@angelru Following is my implementation with a hidden entry field. I didn’t use the TextChange event as it was suggested by @abailie I just bound the ‘Text’ field of the entry (source) to the ‘BarcodeValue’ of the zxing (target)
Thanks Dimitris
This is fixed in the 3.0 series.