Xamarin.forms: How to programatically modify the value of a displayed Display prompt?
Greetings,
I am using android devices connected with Bluetooth scanners. I am trying to adapt some code without rewriting the entire page to accommodate for it.
Basically, whenever something is scanned, the messaging center detect it and start a particular async function: HandleReadLabel. Within said function, I eventually call for DisplayPromptAsync from Xamarin.forms.core with a numeric only keboard. Whenever I scan a product (AE trigger HandleReadLabel) I would like to increment the quantity written in the DisplayPromptAsync by X. Since I'm using it to scan barcode, I have barcodes that mean "This product x2" or "that product x16" and I want to use that table to know by how many to increment the value.
But I do not know how I can impact the DisplayPrompt's value directly. Thank you for the help and have a nice day
protected override void OnAppearing()
{
base.OnAppearing();
//Refresh list on appearing
viewModel.LoadItemsCommand.Execute(null);
//Scanner handler
MessagingCenter.Unsubscribe<App, string>(this, "Barcode");
MessagingCenter.Subscribe<App, string>(this, "Barcode", (sender, arg) => {
Device.BeginInvokeOnMainThread(() =>
{
HandleReadLabel(arg);
});
});
}
public async Task<bool> HandleReadLabel(string labelText)
{
var quantityTransfer = await DisplayPromptAsync(viewModel.primaryBin.labelAdresse, $"Quantité Totale ({productLine.quantityOrdered}): ", placeholder: productLine.quantyReceived.ToString(), keyboard: Keyboard.Numeric);
if (quantityTransfer == "Cancel")
}