The method proposed by Denis Biondich is the right way for a console application. But in response to your question, you could do it this way if you added a link to System.Windows in the links to your application. When you select a console application template, this link is not enabled by default, so if you need members from this namespace, you must add a link to the dll.
source
share