2
Vote

Discrepancy in DialogService between Android and UWP

description

It seems that the DialogService behaves differently on Android than in a UWP app.

Values altered in the afterHideCallback, are do not have their newly assigned value when the dialog is hidden. Adding an extra delay seems to fix this, but I feel the behavior should be the same on all platforms.
var dialog = SimpleIoc.Default.GetInstance<IDialogService>();

string dialogResult = "default value";
await dialog.ShowMessage("text", "title", "yes", "no", 
    (result) => { 
        dialogResult = result ? "yes" : "no"; 
    });

// waiting here makes sure the dialogResult is set on Android
// await Task.Delay(100);

// Android shows "default value", Windows shows "yes" or "no"
await dialog.ShowMessage(dialogResult, "Result");

comments