开发者

WinForm Conversion To Wpf [duplicate]

开发者 https://www.devze.com 2023-02-25 21:20 出处:网络
This question already has answers here: Migrate VB.NET 2.0 Winform to 3.5 WPF (3 answers) Closed 1 year ago.
This question already has answers here: Migrate VB.NET 2.0 Winform to 3.5 WPF (3 answers) Closed 1 year ago. 开发者_运维问答

Can I Convert my whole WinForm Application to wpf application?. I wants to convert my Accounting Software to Wpf Is it possible?.


No - there is no direct translation from Windows Forms to WPF - in addition, doing this directly would be poor, and lead to a very poorly designed WPF application.

I discuss this in depth in my series on WPF with MVVM - in particular, "Part 3" shows what happens when you write WPF using the same manner as typical Windows Forms applications, but then I go onto show why this is a bad idea in general.

WPF, at its core, is built upon a very different programming paradigm than Windows Forms. It would be better to separate out your business logic in Windows Forms, then write a new View layer in WPF to work with the logic.


Its not like converting vb.net to C# or something, WPF is a totally different way of writing windows apps.

However, if you have your code cleanly abstracted, and/or your UI code separated from logic, you shouldn't have too much trouble porting it to WPF.

WPF also does have the WindowsFormsHost class. Here is a Walkthrough on Hosting a windows forms control in WPF.


you'll need to rewrite quite a lot. And it's definitely worth doing to take advantage of MVVM.

0

精彩评论

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