You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In .net framework 4.8 WPF
I New Create UserControl Name "Loading" And apply it Downloader . In another xaml Grid.Children.Add(Loading).Unable to close after download is complete.
prompt:
System.InvalidOperationException:“The calling thread cannot access this object because another thread owns it。”
Ask how to end this object in the loading interface
The text was updated successfully, but these errors were encountered:
When using WPF or another UI framework, it is not possible to directly access the main thread (UI thread) from another thread. Once your downloads are complete and you resume the await task with the result, the current thread may not be the main thread due to the Downloader running scenarios. Therefore, to call UI elements like Grid, you must use the Dispatcher, as shown in the code below:
In .net framework 4.8 WPF
I New Create UserControl Name "Loading" And apply it Downloader . In another xaml Grid.Children.Add(Loading).Unable to close after download is complete.
prompt:
System.InvalidOperationException:“The calling thread cannot access this object because another thread owns it。”
Ask how to end this object in the loading interface
The text was updated successfully, but these errors were encountered: