Invalid .NET Dispatcher class (System.Windows.Threading)

I read about the class Dispatcherin .NET. But curiously, in my case, the namespace System.Windows.Threadingdoes not exist ( MSDN ). Is something wrong with me? Thank you for your help.

+5
source share
3 answers

Check the version and links to the framework (you need a link to WindowsBase and the framework version 3+ or Silverlight)

+5
source

Which project?
Perhaps this is because you write "Class Library".
Check the "Output Type:" on the application tab of the project properties.

, , " System.Threading"; " " , , wpf.

+1

Add WindowsBase Link, then Add

using System.Windows.Threading;

so you can use the code:

System.Windows.Threading.Dispatcher Dispatcher { get; set; }

screenshot: enter image description here

0
source

All Articles