转换的csproj文件从winform中WPF [英] Convert csproj file from winform to wpf

查看:366
本文介绍了转换的csproj文件从winform中WPF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个WinForm的应用程序,有一个非常简单的形式,一个主要的Program.cs文件,大约60后端的.cs文件。我想这个项目转换为WPF应用程序。展望<一href="https://www.google.ca/webhp?ion=1&espv=2&ie=UTF-8#q=convert%20form%20to%20wpf%20site%3astackoverflow.com&safe=off"相对=nofollow>此处并没有表现出任何接近我想要做的。

I have a Winform app that has one very simple form, a program.cs main file and about 60 back-end .cs files. I want to convert the project to a WPF application. Looking here didn't show anything close to what I want to do.

我要

  • 在转换文件的csproj所以它会允许我补充WPF窗口
  • 在这种转换做到位,以保持我的源代码控制整洁,避免在适当的文件夹中加回所有的后端文件的麻烦,加上对外部的依赖,等等。
  • 创建有一个空mainwindow.xaml(+的.cs)文件,我将手动与适当的控制填充。

然后,我将手动拆分视图和视图模型文件之间的旧形式文件的内容。

Then, I will manually split the content of the old forms file between the view and the viewmodel files.

这样做,不是从头开始更简单的办法吗?

Any way of doing that easier than starting from scratch?

编辑:我宁愿不举办新的WPF UI到旧的WinForms外壳,但通过WPF替换当前表单应用程序

I would rather not host the new WPF ui into the old winforms shell but replace the current forms application by a wpf one.

EDIT2:我不要要对整个项目和架构WPF转换(因为它是提出和回答几次SO),我完全理解,这些是2个不同的框架和我我完全愿意做手工的变化。我要转换的的csproj 因此它将编译为一个WPF应用程序,而不是一个窗体应用程序。

I do not want to convert the entire project and the architecture to WPF (as it was asked and answered several times on SO), I totally understand that these are 2 different framework and I am totally willing to do the change manually. I want to convert the csproj so it will compile as a WPF app instead of a Forms app.

推荐答案

这似乎从你的EDIT2,你只是想从的WinForms到WPF改变项目类型不改变任何项目的项目。我不知道你为什么要做到这一点,但尝试创建一个空的WinForms项目,然后创建一个空的WPF项目,然后比较这两个项目文件。

It seems from your edit2 that you just want to change the project type from "Winforms" to "WPF" without changing any of the project items. I don't know why you want to do this, but try creating an empty Winforms project, then creating an empty WPF project, then comparing the two project files.

无论所不同的是两个空项目之间,做出改变现有的WinForms项目。

Whatever the difference is between the two empty projects, make that change to your existing Winforms project.

这篇关于转换的csproj文件从winform中WPF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆