ComboBoxSelectionChanged(object sender, SelectionChangedEventArgs e) _comboBox.Dispatcher.InvokeAsyncInvoke(sender, EventArgs.Empty));意思是Dispatcher' does not contain a definition for 'InvokeAsync' and no extension me
我在Blazor服务器端页面上设置了一个计时器。目标是每隔x秒调用一次API,并根据返回值更新UI。UI使用新的时间值每秒更新一次。但是,我不知道如何调用异步任务来获取值。我想替换下面这行: Time = DateTime.Now.ToString(); 使用一行代码调用以下函数: private async Task<string> GetValue() varUse InvokeAsync() to switch execution to the Dispatcher<
当从异步方法调用UI组件时,我在Blazor服务器端应用程序中遇到此异常。:35:49.358Z] Error: System.InvalidOperationException: The current thread is not associated with the DispatcherUse InvokeAsync() to switch execution to the Dispatcher when triggering rendering or component state.at Microsoft.Asp
good - async void -> no error handling Dispatcher.CurrentDispatcher.BeginInvokevar task = await Dispatcher.CurrentDispatcher.InvokeAsync(async () => var a =var tcs = new TaskCo