I have the following code:
var queue = printer.PrintQueue;
var canPrint = ! Dispatcher.CurrentDispatcher.Invoke(()
=> queue.IsPaperJammed || queue.IsOutOfPaper ||
queue.IsInError || queue.HasPaperProblem);
It is throwing the following error:
The calling thread cannot access this object because a different thread owns it
I have tried this on UI thread (using the dispatcher as shown above) and I have tried it on the current thread (without the dispatcher).
Is there a way to ask a object which thread owns it?