Question System.Windows is not allowing me to use Window

unSatisfied

New member
Joined
Jan 25, 2014
Messages
1
Programming Experience
3-5
Ok so i'm trying to do the following and VS gives me an error saying its not referenced when i am using System and using System.Windows


Window x = new Window()


Seems like the stupidest question ever but it wont let me use it?
 
What type of project did you create in the first place? If you're trying to create a Window object then you must be wanting to use WPF, so did you create a WPF project in the first place? The Window class is defined in the PresentationFramework.dll assembly so you need a reference to that assembly in order to use that class. Normally you wouldn't actually create an instance of the Window class either. You'd normally design your own windows that inherit the Window class and then you'd create instances of those.
 
Back
Top Bottom