You need to reference the Microsoft PresentationFramework assembly because you are trying to use WPF namespace .
If you created a WPF project from scratch, it must be enabled. When you start in VS with some other type of project, you may need to add this link manually. Right-click the node links in your project, add the Add Link command. Then, in the dialog that appears, you go to the .NET tab and view the assembly you want.
source share