Upgrading a WinForms app to WPF

后端 未结 4 1472
面向向阳花
面向向阳花 2020-12-03 03:34

I have a side project that I wrote a few years ago in WinForms. To better help me learn WPF, I would like to rewrite it in WPF. Ideally, I would like to just modify the curr

4条回答
  •  长情又很酷
    2020-12-03 04:32

    Sailing Judo's answer worked for me to convert a WinForms project into a WPF, but did not describe in detail what is needed;

    1. Open the csproj file for the project you want to convert.
    2. Search for the string - most likly it will not exist.
    3. Add the following within the tag of the project file. If you have multiple PropertyGroup tags, use the one without a Condition attribute (e.g. the default properties).

      {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}

    4. Save - if you have the project open VS will ask to reload the project.

    From what I see and test, I can now easily add WPF Windows and WinForms. My older WinForms also work without problems.

提交回复
热议问题