0

We have an old application built on .Net 1.1 Framework and Winforms. We are planning to migrate it to the latest version of .Net.

Here are some of the questions running in my mind:

  1. Should we go with Winforms or WPF?
  2. We want the design and structure to the exact same as what we have now.
  3. What kind of pitfalls can I expect when migrating?
  4. Is there any place where I can lookup to see the process of migration?
  5. Any other suggestions?
8
  • 2
    I have a feeling that this question is either too broad or off-topic for the format of Stack Overflow. Commented Mar 25, 2015 at 17:01
  • You are missing some information as to the specifics of the environment you are working in. For example, if you are still running Windows XP, .NET 4.5 isn't even an option for you. Commented Mar 25, 2015 at 17:06
  • "We want the design and structure to the exact same as what we have now." Really? Why would you want that? .NET 4.5 and WPF enable way better designs than those possible with 1.1 and Winforms Commented Mar 25, 2015 at 17:10
  • @EugenePodskal: I understand it's too broad.. but I had nowhere else to go. Sorry about that. Commented Mar 25, 2015 at 17:23
  • @OhaxNuv: It'll be Windows 7 and newer os. Commented Mar 25, 2015 at 17:23

1 Answer 1

9

Should we go with Winforms or WPF?

This is a very broad question. But my answer to that would be this. Winforms designer is a painful experience and it is not as flexible as WPF by any means so if that is important to you then you should.

We want the design and structure to the exact same as what we have now.

Anything you do in Winforms you can replicate in WPF so no worries there.

What kind of pitfalls can I expect when migrating?

There are too many to name one of the most common ones for our migration was converting existing logic in the WinForms (yes it was a crappy, outsourced, legacy WinForms full of business logic) and connecting it to WPF elements. The process in and of itself is not that complicated but when you have too many intertwined pieces it can get pretty ugly.

Is there any place where I can lookup to see the process of migration?

The process of migration pretty much has to be iterative. So the way many people do it based on my research (articles, StackOverflow answers and such) is through ElementHosts.

1) Target a certain part of your WinForms that you would like to switch up to WPF and then take it out.

2) Replace it with ElementHost.

3) Then in that ElementHost you will have your newly rewritten WPF counterpart.

4) Test it out make sure that it works okay with the rest of the elements.

5) Go to step 1 until rest of the stuff on that window is replaced (You can do header, middle, footer or top, bottom any way you wish to go about replacing elements on the window it depends on your particular situation).

6) Once most of the stuff is replaced you can then combine all of those WPF User Controls into a WPF Window.

Sign up to request clarification or add additional context in comments.

3 Comments

And please, for the love of all things .NET, use MVVM for the WPF pieces.
@AvetisG: Thank you for the reply. This kind of helps me get started.
@BradleyDotNET: If it's in WPF.. I will definitely go with MVVM. Thank you for the suggestion

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.