Hello All,
I am migrating some VB.NET 1.1 code to WPF C# (.NET 3.0). Here is what I have done till now:
Before we move on, remember that the existing application is GDI intensive application and we are migrating JUST the graphics part to WPF for performance reasons.
So the approach has been,
1.) Migrate from VB.NET 1.1 to C# (I have used some conversion utility to do this job, although the result have been not so good, it has helped me get a basic structure ready)
2.) This C# code is at most .NET 2.0 compliant, because of the namespaces it uses. Namespaces like System.Windows.Forms, System.Drawing, System.Drawing.Drawing2D etc have no place in WPF based applications (or .NET 3.0).
3.) I am finding the equivalent namespaces in .NET 3.0 and figuring out what needs to be ported/re-written in 3.0 and doing so. But there are some classes within my application which interact with the graphics engine and pass the graphics engine object of these 2.0 namespaces like System.Drawing.Point, System.Drawing.Graphics as an example. I will not be able to change the types of arguments that these classes pass to the graphics engine.
I am in a dillema as to what the 3.0 WPF graphics engine should accept as parameters Should I take 2.0 inputs and convert them internally and do the processing OR should I have an interface that will accept the 2.0 parameters and convert them to 3.0 equivalents and pass these 'now-converted' parameters to a pure WPF graphics engine Which approach is better Are there any other approaches What are the pitfalls in either of them Do I have some tools/utility/code to do the conversions or I have to do them manually
Please guide. Thanks in advance.
Best Regards,
Kanhaiya.

Best approach for migrating projects.
CharlieDigital
Hello Mike,
But I see the question differently. Kanhaiya is asking the best approaching for converting parameters (which are in different namespaces in both the version)..so if for example, I have a method called drawline(Point P1, Point P2) in 2.0, it refers to namespace system.Drawing.Point and if the same method has to be ported/migrated to .NET 3.0 , one would use System.Windows.Point. So his question is about conversion of parameters in both the versions..if i am not wrong..
~Rohit.
fly2moon2
Thanks ivolved_Mike_Brown,
Can you provide me some sample which makes me more clear about it
Best Regards,
lnmthuc
The PropertyMap on ElementHost should help you to a degree. Also, a good amount of the functionality found in GDI is supported (and easier to program) in WPF.
Also, see this MSDN Article about interop and migration in general
GShap
GeorgeMohr
Hi Kanhaiya,
Could you please elaborate the scenario