Zxing.net.mobile: ZXingBarcodeImageView.BarcodeOptions can't be set using just XAML

Created on 28 Nov 2016  路  3Comments  路  Source: Redth/ZXing.Net.Mobile

I'm using ZXingBarcodeImageView to show my QR, and was expecting having to avoid to use the BindingContext for anything other than the data, but I can't find a way to declare the BarcodeOptions without using C# (which means binding it). It would be great if it could be declared like so:

<zxing:ZXingBarcodeImageView BarcodeValue="{Binding Code}" BarcodeFormat="QR_CODE" BarcodeOptions="Height=300,Width=300,Margin=10" />

Most helpful comment

Actually, it can

xmlns:zx="clr-namespace:ZXing.Net.Mobile.Forms;assembly=ZXing.Net.Mobile.Forms"
xmlns:zxcm="clr-namespace:ZXing.Common;assembly=zxing.portable"
<zx:ZXingBarcodeImageView
                    BarcodeFormat="QR_CODE"
                    BarcodeValue="{Binding QrCode}"
                    HorizontalOptions="FillAndExpand"
                    VerticalOptions="FillAndExpand">
                    <zx:ZXingBarcodeImageView.BarcodeOptions>
                        <zxcm:EncodingOptions Width="300" Height="300" />
                    </zx:ZXingBarcodeImageView.BarcodeOptions>
                </zx:ZXingBarcodeImageView>

All 3 comments

Actually, it can

xmlns:zx="clr-namespace:ZXing.Net.Mobile.Forms;assembly=ZXing.Net.Mobile.Forms"
xmlns:zxcm="clr-namespace:ZXing.Common;assembly=zxing.portable"
<zx:ZXingBarcodeImageView
                    BarcodeFormat="QR_CODE"
                    BarcodeValue="{Binding QrCode}"
                    HorizontalOptions="FillAndExpand"
                    VerticalOptions="FillAndExpand">
                    <zx:ZXingBarcodeImageView.BarcodeOptions>
                        <zxcm:EncodingOptions Width="300" Height="300" />
                    </zx:ZXingBarcodeImageView.BarcodeOptions>
                </zx:ZXingBarcodeImageView>

Thanks! Unfortunately I'm no longer working on this project, but it would be great if this was added to the documentation if it isn't already, because it wasn't obvious when I tried it.

Thanks for reporting this issue! Unforunately it took me way too long to respond 馃槶. Sorry, I apologize! Recently the source code for this project was completely refactored to modernize it. Many PR's were included in this effort, and many bugs were hopefully fixed. Please try out the latest 3.x series of NuGet packages (currently in prerelease). To try and make the project more maintainable in my spare time going forward, I've decided to close all existing issues to start with a clean slate. If you're still experiencing this issue on the newest version, please open a new issue with as much detail as possible. Thank you for your patience and understanding! Happy scanning!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mdkitzman picture mdkitzman  路  7Comments

jhealy picture jhealy  路  6Comments

radioactiveman picture radioactiveman  路  7Comments

Zexuz picture Zexuz  路  6Comments

horacehylee picture horacehylee  路  7Comments