【发布时间】:2018-07-10 05:35:13
【问题描述】:
我想在每次触发特定的TextChanged 事件时重新绘制我的二维码。
当使用 XAML 文件中设置的值 BarcodeValue 加载页面时,ZXingBarcodeImageView 对象将在视图中绘制,如下所示:
<forms:ZXingBarcodeImageView
Margin="5,5,5,0"
x:Name="QRCodeView"
BarcodeFormat="QR_CODE"
BarcodeValue="-1" //this is the value of the QR code
/>
我有一个 Entry 附加了一个 TextChanged 事件,它触发了一个函数 UpdateQRLabel。这个函数应该用Entry中的新值重绘二维码
<Entry
x:Name="Message"
TextChanged="UpdateQRLabel"
/>
如果我在绘制 QRCode 后更改 BarcodeValue 参数,它不会自动重绘。
每次触发TextChanged事件时,我都需要强制ZXingBarcodeImageView对象重绘。
问题
当TextChanged事件被触发时,如何强制ZXingBarcodeImageView重绘?
【问题讨论】:
标签: xamarin xamarin.forms