I have a number of dialogues which I call from async threads, and this does not works.
For instance :
protected override void OnAfterRender( bool firstRender )
{
base.OnAfterRender( firstRender );
if( firstRender )
{
var isEmbedTask = jSRuntime.InvokeAsync<string>( "getEmbedInjection" );
isEmbedTask.ConfigureAwait( false ).GetAwaiter().OnCompleted( () =>
{
var o = isEmbedTask.Result;
isEmbed = string.IsNullOrWhiteSpace( o ) == false;
if( isEmbed )
{
loginDialog.Hide();
dialogLoingVisibility = false;
}
else
{
dialogLoingVisibility = true;
loginDialog.Show();
}
} );
this will not work until I click somewhere in the window, then the new visibility will be applied.