I'm working on blazor server side application.
After update Telerik.UI.for.Blazor from 2.1 to 2.5 (before I
updated .net core from 3.0 to 3.1) it shows following error:
InvalidOperationException: The current thread is not associated
with the Dispatcher. Use InvokeAsync() to switch execution to the Dispatcher
when triggering rendering or component state.
I investigated that it's cause by Telerik window.
The error occurs when window is on start page or when the
page is refreshed.
Below code for Index.razor which cause the error:
@page "/"
<
TelerikWindow
@
bind-Visible
=
"@WindowIsVisible"
>
<
WindowTitle
>
<
strong
>The Title</
strong
>
</
WindowTitle
>
<
WindowContent
>
This is my window <
strong
>popup</
strong
> content.
</
WindowContent
>
<
WindowActions
>
<
WindowAction
Name
=
"Minimize"
></
WindowAction
>
<
WindowAction
Name
=
"Maximize"
></
WindowAction
>
<
WindowAction
Name
=
"Close"
></
WindowAction
>
</
WindowActions
>
</
TelerikWindow
>
<
TelerikButton
OnClick="@( () => WindowIsVisible = !WindowIsVisible )">Toggle window</
TelerikButton
>
@code {
bool WindowIsVisible { get; set; } = false;
}