Does WPF use dispatcher.begininvoke method for user interface?

I have a WPF application that uses multiple threads. I'm curious to know if you are calling the UI thread using the Dispatcher.BeginInvoke () method, which is considered thread safe? Normally, I would use a lock statement to make sure that only one thread can access a variable. Will the following be in a streaming secure WPF application?

this.Dispatcher.BeginInvoke(() =>
{
    _counter ++;
});
+5
source share

All Articles