麻烦在VS 2010中一个控制台应用程序转换为WPF应用程序应用程序、控制台、转换为、麻烦

2023-09-03 05:16:29 作者:半成熟的幼稚鬼

我创造,我后来决定将更好地发挥作用作为一个WPF应用程序控制台应用程序。我改变了输出类型的Windows应用程序,并添加了我认为是必要的参考。不幸的是,在项目上右击不允许我添加一个资源词典或许多其他WPF类型。什么我错过了?

I created a console application that I later decided would function better as a WPF application. I changed the output type to Windows Application and added what I believe are the necessary references. Unfortunately, right-clicking on the project does not allow me to add a Resource Dictionary or many other WPF types. What have I missed?

推荐答案

最简单的方法是创建一个新的WPF应用程序和移动code。最好的方法是将逻辑推入企业库中,所以你可以很容易地使用一个控制台应用程序和一个WPF应用为presentation技术,业务逻辑,因为WPF是一个用户界面技术,而不是应用程序类型。

The easiest method would be to create a new WPF application and move the code. The best method would be to push the logic into a business library so you can easily use a console application and a wpf application as the presentation technology for the business logic, because WPF is a user interface technology, not an application type.

这是一个怪胎的角度来看,如果你想解决学习困难的方式,我会创建一个单独的WPF applicationn并检查该凸出文件。很可能是在那里的一些点点,使事情的工作为WPF,以及一些丢失的引用。

From a geek standpoint, if you want to solve the hard way to learn, I would create a separate WPF applicationn and examine the proj file. Most likely there is some little bit in there that makes things work as WPF, as well as some missing references.