WinForm Conversion To Wpf [duplicate]
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.
精彩评论