WPF's Dispatcher.CheckAccess()
missing in intellisense
#10084
Replies: 2 comments 4 replies
-
Not sure what you are asking about. If whether the two members are still hidden from intellisense, then yes:
Methods are not self-blocking by default (not even sure what that would mean), so I don't see the need to mention that, or any claim otherwise to refer to. Dispatcher.Invoke and Dispatcher.BeginInvoke are not equivalent. The latter places the callback on the queue at Normal priority. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your reply. I know that these members are still hidden. I was referring to the reason for hiding them. Is there still a reason for it? If not, they should be made visible again, which I would prefer.
Let me explain with some more details: |
Beta Was this translation helpful? Give feedback.
-
Today, I noticed that WPF's
Dispatcher.CheckAccess()
is not shown in intellisense.https://github.com/dotnet/wpf/blob/main/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/Threading/Dispatcher.cs
A possible reason is given in this answer on stackoverflow:
Is it still true?
I use
CheckAccess()
in scenarios like the following:But today I also found https://stackoverflow.com/questions/43364132/why-does-wpfs-dispatcher-invoke-not-cause-a-deadlock-when-run-on-the-main-threa/43364665
and also found the code
from this stackoverflow answer inside the
Dispatcher.cs
. Therefore, I think I could directly callInvoke()
instead:Whatever is the better solution (comments are welcome), in every case should the remarks on https://learn.microsoft.com/en-us/dotnet/api/system.windows.threading.dispatcher.invoke be enhanced by some information that
Invoke()
is not self-blocking.Beta Was this translation helpful? Give feedback.
All reactions