Maybe a stupid question, but when I add item to a WPF project, Visual Studio only offers me UserControl, and not Window. Is this trying to encourage me to do MVVM, is my setup broken, or is there some other reason I haven’t thought of?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Your project is probably configured as a WinForms project, or possibly as a class library. If it’s created as either of these, you are only able to add a WPF UserControl, unfortunately.
Of course, there’s no technical reason for this limitation, so you can copy/paste one from another project or recreate/change your project to be a WPF project.
I’m not sure what you change exactly to make it a WPF project in VS’s eyes. You might try creating a new project and diffing it to your current project. You will most likely have to do some text editing on your
.csprojfile.