Hi
I am using Image Button with this code:
ImageButton imageButtonStampa = new ImageButton() { Style = (Style)Application.Current.Resources["imageButtonStyle"] };
imageButtonStampa.SetBinding(ImageButton.CommandProperty, "StampaCommand");
imageButtonStampa.SetBinding(ImageButton.IsEnabledProperty, new Binding("NewBarcode", converter: new IsNotNullToBooleanConverter()));
imageButtonStampa.SetBinding(ImageButton.SourceProperty, new Binding("NewBarcode", converter: new IsNotNullToSourceConverter(), converterParameter: stampaSources));
First time I open the page I have this:
Then I insert some data, IsNotNullToSourceConverter fires and Source changes:
Now, when I press the ImageButton, I send some data to a bluetooth printer.
StampaCommand = new Command(async () => {
try
{
if (_isTapped)
return;
_isTapped = true;
await Util.Print.PrintBarcode(Preferences.GetPrinterBarcode(), NewBarcode);
_isTapped = false;
}
catch (Exception ex)
{
_isTapped = false;
await Application.Current.MainPage.DisplayAlert(AppResources.Attenzione, ex.Message, AppResources.Ok);
}
});
But I have this problem:
and when print is finished, the problem remains:
If I rotate the screen, problem disappears:
What can I do for this?
Thanks
Alessandro