开发者

How to convert .NET WPF application to Windows Forms?

We have created a beautifully designed .NET WPF desktop application. We are installing the application with InnoSetup , and if .NET 3.5 is not present, it automatically installs it. However, the package to download .NET 3.5 is huge and we found out that about 30% of users do not finish instalation due to this.

The obvious solution is to recode everything into .NET 1.1 with Windows Forms but its a major development which would take few weeks. Also, we would then face dilemma if to support both versions (and use innosetup to choose the right one) or just ditch WPF all together.

Is there any easy way how to convert WPF to Windows Forms? Or do we have any alternative options to 开发者_运维技巧consider?

Thank you!


Converting WPF to WinForms is not trivial, there is certainly no automated way, and if you want to go back to .net 1.1 as well you'll lose a whole load of other features like generics etc, so it's not just the UI you'll be changing.

The best solution would be to target the .net client profile instead. It's a much smaller download.

If you can wait a few weeks, the client profile in .net 4.0 has far better offline installation and platform support. See here and here.


You could use the .NET Client Profile introduced in .NET 3.5 SP1 in order to reduce the size of the download required to run the app on computers without the .NET Framework 3.5 installed.

The .NET Client Profile is about 28 MB in size, as described here.

Also, have a look at this site to determine the smallest, easiest download required to get the .NET Framework on your system.


Since you say "beautifully designed", I'm going to assume that you made extensive use of WPF's UI elements. If this is the case, forget about porting the UI back to WinForms.

The non-UI parts of your program can be back-ported easily (possibly with no changes at all) IFF (if and only if) they don't reference any post-2.0 stuff (like LINQ, for example).


Did you try the Client only framework subset? You just check a box in your project setup and it will use a slimmed down 26 mb version of .net 3.5. It is also known as Client Profile

How to convert .NET WPF application to Windows Forms?


(source: msdn.com)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜