Click here to Skip to main content
15,891,895 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends,

I'm working on .Net on Windows Application. In this project we have 50 forms are there, now we need to convert the entire application to WPF for rich UI. I there any better way for doing this.

Please give me the suggestions for this.

Regards,
Harish Reddy
Posted

Yes, there is a better way: write new application from scratch, using just the ideas from old application. The more you try to "reuse" the UI code, the more time you will waste — this observation was done on several projects.

Of course, if you managed to separate non-UI code from UI well, you will be able to reuse most or all of it.

—SA
 
Share this answer
 
Comments
Philippe Mori 3-Dec-11 9:46am    
In theory... In practice, if the application is large and complex and the team is small or even a single programmer, it might be impossible to rewrite the application in a time-frame that is acceptable for the company you work for.
Sergey Alexandrovich Kryukov 3-Dec-11 21:52pm    
Yes, sure, it can be impossible; I agree. My only statement is this: an attempt to migrate it is even "more impossible".
--SA
Also, if you have a lot of forms, then maybe you can still use WinForms for many of them during the transition.
 
Share this answer
 
v2
Comments
Sergey Alexandrovich Kryukov 2-Dec-11 19:42pm    
What do you mean, combination of Forms and WPF in one application? In principle, this is possible (I experimented running two Applications of in a single process using two different threads), you also can embed WPF control in a Form and a Form's control on a WPF Windows, but it's too much buzz. Combination of these two libraries isn't really easy.
--SA
Philippe Mori 3-Dec-11 9:19am    
Well for a large application if the team is small, it might not be feasible to convert the whole application at once in a reasonable time.

One approach would be to start using some WPF controls or windows inside the existing application where the benefit is high and later switch the application itself to WPF.

The second approach would be to start a fresh WPF application but reuse some existing forms (one can easily convert a form to an user control an host that user control in a WPF window).

Assuming that the 50 forms of the original user are dialogs, the second approach might make more sense. Continue to show old dialogs with something like (new MyForm()).ShowDialog(owner) until those dialogs are converted.

Presently, I haven't much used WPF in a professional application except that I have hosted some third party WPF components inside my WinForms.
Sergey Alexandrovich Kryukov 3-Dec-11 21:54pm    
Did you actually try to combine WPF with Forms in any way? It's possible but can result in huge waste of time. However, it depends.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900