Tengo una vista con la implementación del ZXingBarcodeImageView
<zx:ZXingBarcodeImageView BarcodeFormat="QR_CODE"
BarcodeValue="{Binding QrCode}"
VerticalOptions="End"
HorizontalOptions="CenterAndExpand"
HeightRequest="180"
WidthRequest="180" Margin="0,15">
<zx:ZXingBarcodeImageView.BarcodeOptions>
<zxcm:EncodingOptions Width="300" Height="300" />
</zx:ZXingBarcodeImageView.BarcodeOptions>
</zx:ZXingBarcodeImageView>
y tengo en el ViewModel la propiedad, el error radica cuando navego a la anterior vista, lanzando el siguiente error.
System.ArgumentException: Found empty contents
En el ViewModel, se tiene lo siguiente:
public class CarnetViewModel : BindableBase, INavigationAware, IDestructible
{
protected INavigationService NavigationService { get; private set; }
public CarnetViewModel(INavigationService navigationService)
{
NavigationService = navigationService;
}
/// <summary>
/// The qr code
/// </summary>
private string qrCode;
/// <summary>
/// Gets or sets the qr code.
/// </summary>
/// <value>
/// The qr code.
/// </value>
public string QrCode
{
get => qrCode;
set { SetProperty(ref qrCode, value); }
}
}
NOTA: Se tiene implementado el Framework Prism para la navegación y MVVM.
Realizando un seguimiento encontré un error más detallado, pero igual no se como puedo controlarlo.
Unhandled Exception from source=AndroidEnvironment
System.ArgumentException: Found empty contents
at ZXing.QrCode.QRCodeWriter.encode (System.String contents, ZXing.BarcodeFormat format, System.Int32 width, System.Int32 height, System.Collections.Generic.IDictionary`2[TKey,TValue] hints) [0x00008] in <ccd33a3710ff407d90a31fb75c8c27de>:0
at ZXing.MultiFormatWriter.encode (System.String contents, ZXing.BarcodeFormat format, System.Int32 width, System.Int32 height, System.Collections.Generic.IDictionary`2[TKey,TValue] hints) [0x00033] in <ccd33a3710ff407d90a31fb75c8c27de>:0
at ZXing.BarcodeWriterGeneric.Encode (System.String contents) [0x0002f] in <ccd33a3710ff407d90a31fb75c8c27de>:0
at ZXing.BarcodeWriter`1[TOutput].Write (System.String contents) [0x00013] in <ccd33a3710ff407d90a31fb75c8c27de>:0
at ZXing.Net.Mobile.Forms.Android.ZXingBarcodeImageViewRenderer+<>c__DisplayClass5_0.<regenerate>b__0 () [0x00000] in <6a1930ceea034eb28eda2834838f88c6>:0
at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <a10f61e70eeb434e952fef884856c199>:0
at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in <a10f61e70eeb434e952fef884856c199>:0
at (wrapper dynamic-method) System.Object.48(intptr,intptr)