Replies: 1 comment
-
I don't know why the code above runs on a non-UI thread. Changing the code above to do this instead: public async Task ShowDialogAsync()
{
bool okClicked = false;
var dialogActions = new DialogAction[]
{
new DialogAction("OK") { Action = () => okClicked = true },
new DialogAction("Cancel"),
};
try
{
await _navigator.ShowMessageDialogAsync(this, "Some Title", "Some Content", buttons: dialogActions);
}
catch (Exception ex)
{
}
if (okClicked)
{
await DialogResult.SetAsync("OK");
}
else
{
await DialogResult.SetAsync("Canceled");
}
} Still hits the exception block. Also, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Already checked:
xamlRoot is not null at this time
My calling code:
Task Code in MainModel:
DialogResult Property from Task content is in MainModel:
In my opinion that should be all fine and working, but somehow it is throwing this exception
Could someone have a look on this and help me what I should change?
Repo link:
https://github.com/DevTKSS/MyUnoApp.git
Possibly related to the mvux pattern thing, so maybe a mvux issue?
#18598 (comment)
Seems to not happen in mvvm
Beta Was this translation helpful? Give feedback.
All reactions