I am working on a user control for UWP and is updating some of its visual effects on certain calls. However, since the .NET core library was biased and the stream classes were greatly reduced, I donβt know how to identify from the method in the user control if the calling thread is a UI thread or not, so it knows whether or not to use the dispatcher to change dependency properties.
Does anyone know how to do this?
EDIT: A dispatcher can functionally "invoke" an asynchronous tone in a user interface thread. However, I really donβt know if it is a good idea to try to call the main thread from the main thread through the dispatcher.If someone has a reason, is it good or bad, this will also help answer the question. If there is no reason not to use the dispatcher in the main thread, then I think that there are no problems.
multithreading c # windows-10 uwp
ThisHandleNotInUse
source share