Delphi Handbooks Collection


Delphi XE Handbook


Delphi 2010 Handbook


November 23, 2010

Migrating from WinForms to WPF?

Pete Brown of Microsoft wants to help developer migrate from WinForms... but do they want?

Pete Brown, Developer Division Community Program Manager at Microsoft, wants to help developer migrate from WinForms"I want to help Windows Forms developers transition applications to Silverlight and WPF."

Why? Hope Microsoft is not going to kill WinForms (hey, I'm joking!). The blog post in itself is not very relevant, although I find it quite strange that Microsoft is pushing for this transition from Windows (since WinForms is tied to the Windows API, more or less like the VCL) to a cross-platform solution. But I did notice some of the comments.

This is a short (and very biased) summary of reasons NOT to migrate to WPF:

  • "Users may have more than one of these applicatons open at a time so with the default behaviour of WPF which does not have an equivilant for MDI parent the users may get lost"
  • "We are scared because of XML syntax and designer in VS 2008. Also I heard WPF performance sucks."
  • "How about MS go ahead and make use of WPF in their flagship products (Windows, Office). We are not comfortable seeing MS doen't use WPF in those products."
  • "Databinding is a mess in WPF and Silverlight. It's half-baked -- no type safety, poor performance, and inconsistent, byzantine conventions."
  • "My application does most of the control creation on run time... So, XAML is not useful."
  • "The main thing I'd like is for WPF and Silverlight to be treated equally. Right now, it seems that SL is receiving all the fanfare"
  • "Winfrom apps have a well understood ux model (e.g Menu bar File/Edit/Help) and a consistent look and feel with their surrounding applications as far as Windows controls (at least until Vista)"
  • "I have the reason why not [move to WPF] documented" at http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/a-few-reasons-why-i-m-not-yet-moving-to
  • "Large applications developed during more than 2 or 3 years, it does not make sense, from a financial point of view to "transition" to WPF or Silverlight"
  • "Do not forget that still today many big companies are still actively developing very large applications using WinForms, started no longer than 1 or 2 years ago, so we expect Microsoft to invest in actively supporting WinForms, in paralel with WPF in the forseeable future"
  • "What business value does migrating from WinForms truly offer?"
  • "The end users are running older model windows XP based machines"
  • "The UI design was simply to replicate as closely as possible, the look and feel of the other [Windows] app."
  • "How would spending many man months (more likely, man years) moving to WPF help us meet our next deadline?"
  • "We have about 10 devs working on our app, and at least two active branches, so the concept of having yet another team converting the code to WPF, while customer are still demanding quick enhancements is unthinkable."
  • "Lack of business controls. WinForms doesn't have a lot of good controls built in but there are mature 3rd party libraries like DevExpress."
  • "Incredibly complicated design system."
  • "As a Windows developer and longtime VS user I have no time for or interest in learning and using Expression Blend."
  • "No MDI in WPF"

My comments? (i) Welcome to the real world, where developers have goal other than playing with the development technology. (ii) Rather than move from WinForms to WPF, were Microsoft to downplay WinForms role, I'd rather get (back) to Delphi. (iii) See also the Evernote story I mentioned in my Silverlight blog post: If you transition from WFP, go to Delphi and not to C++. 

Of course, there were also positive comments, but also some negative ones including asking why this info is in a personal blog and not on an official Microsoft site. One side reasons I posted this list is that I think almost everything applies if you are thinking of moving from Delphi's VCL to WPF.





 

10 Comments

Migrating from WinForms to WPF? 

Marco - Is data binding half baked if you consider 
that the direct access to the DB will be cut off?;). 
Maybe I am totally wrong, but currently the made the 
caching available not only on ASP.net also to 
any .net app ... ORM+Cache from MS. I don't know if 
this makes me fear;). EFW .4x evolution is pointing 
into this direction.

I agree with you - no one will move an application if 
it is not required. Anyway does there exist a clean 
64-bit implementation of Winforms? ... they call the 
Win32 API while the managed part is .net and with 
this compatible with 64bit in Windows 64bit model.

The point why it is currently hard to decide is the 
availability of .net 4.x on 17% to 18% of the worlds 
PCs and the second thing is graphic chips that allow 
fast graphics processing (really fast ... CUDA 
parallized...) are integrated on mainboard that live 
longer (more layers) and the silent coolers as well 
as Laptops. And you pointed it out ... the existing 
hardware ... only 1% of the computers change per 
month maybe little more but the still exist;)

For D-A-CH it looks differnt - btw. OS/X Share in 
Swiss is 15%, not overwhelming but interesting.
http://blog.this.at/

WPF can be slow if it runs on GDI. The moment the 
graphic card is performant enough ... it is an 
appropriate alternative still ressource consuming, 
agree. Windows currently with GDI totally bypasses 
CUDA on Nvidia Graphics Cards ... (CUDA is sthg. like 
little vecor computers campareable to the chips on HP 
Vector Graphic cards).

On word on Silverlight:

Silverlight - I think the reason why there was so 
much rumor about Silverlight was
a) WPF and .net 4.x require WinXP SVP3
b) Silverlight need these days WinXP SVP 2
c) Giving an explaination, who MS was going to fill 
the Store for the WP 7...
d) Line of Business Application WCF + Silverlight as 
RIA in a Sandbox.
e) Azure
f) dream of cross plattform this way

The situation is still not clear where to move to 
away from Winforms ... for 3 years now. WPF and 
Thirdparties - my feeling about WPF is that is here 
because no thirparties are welcome. The point with 
WPF is that its from programming less Delphi and more 
in the fashion of C++ and visual class library when 
one is fully going to exploit the potential. 
Developers will not use Expression Blend and the 
Studio if not enough.

Comment by Michael Thuma on November 23, 17:01

Migrating from WinForms to WPF? 

 >>We are scared because of XML syntax and designer in 
VS 2008...
Look at the Flashbuilder and you will know why this was 
shown:))) >>everywhere<<.
Comment by Michael Thuma on November 23, 17:03

Migrating from WinForms to WPF? 

I have a DevExpress .NET subscription. Anytime I feel 
like maybe I should give WPF another chance I open 
their demo applications and watch resource monitoring 
software. That cures me every time...

I do I/T work primarily, not programming, and in my 
business I see a good number of networks. I don't 
know who these WPF advocates are writing these apps 
for. The client I worked for this last Saturday 
(lumber company) would probably have to replace five 
of his six workstations if I were to write a WPF app 
for him. I have a friend doing I/T next door to them 
for a steel company. They still have windows 95 
machines with specialized software running big 
equipment. You simply can't upgrade this stuff 
without massive expense. Am I the only one whose 
customers and friends customers could never afford a 
large WPF aplication? I think the "success" of WPF 
clearly shows I'm not the only one. Business wants 
the best ROI they can get on hardware purchases. The 
tech bubble is over and we're in the midst of a 
miserable recession here in the US. I understand 
Microsoft's need to push forward (if WPF can be 
called "forward"), but they need a reality check. 

Beyond that their toolchain is schizo. Which .NET 
version should I write an app to? Then which UI 
technology should I use? Winforms? WPF? Silverlight? 
ASP.NET Winforms? ASP.NET MVC? Or even go back to MFC 
with C++? Too many options. Giving me a headache just 
thinking about it...
Comment by Ron Grove [http://www.evanoah.com] on November 23, 22:16

Migrating from WinForms to WPF? 

Ron... you are not the only one, believe me. 

I have an example in steel where a combination of a 
data cache implemented in managed C++ and WPF on the 
frontend is used for logistics optimization. This 
application is an advantage as the optimization now 
takes max up to a few seconds (up to max 4 but 1,5 in 
an average depending on the granularity). This has 
nothing to do with WPF, because all the data binding 
has been rewritten from the scratch .... data driven 
analytical applications.

Ron see it realistic ... ASP.net is the point and if 
you have a devexpress subscription for VCL which 
includes ASP.net controls you are very close to what 
is required.

Mike
Comment by Michael Thuma on November 24, 12:14

Migrating from WinForms to WPF? 

I would never ever migrate from WinForms to WPF as I
would never ever migrate from Delphi VCL to .NET
WinForms. This is obviously waste of time nad money. 

Large company where I live has rewritten their
application GUI from Clarion to WinForms .NET recently
and from resonably quick interface they made a
crawling turtle. There is no single customer who likes
new interface but I guess they will still use the
program casue they invest to much in it.
I am wonder, how many of the companies which have
rewritten their apps from Delphi to .NET are actually
happy with the performance and look of their apps.

Now Microsoft is pushing for their new crawling
turtle(WPF) which have been built on their old
crawling turtle (.NET).

And if I need graphicaly rich interface, something
which WinForms can't do, why on earth I shall chose
some slow wrapper for DirectX instead of DirectX
itself?. Because of XAML? Sorry, I have my own config
XML file for the GUI controls in pure Direct3D.
Moreover I can reuse my Free Pascal application and
switch in no time to OpenGL.
Comment by Unspoken on November 24, 14:15

Migrating from WinForms to WPF? 

Until MS uses their own migrated advice to their
products, then I will follow.  This is just a way for
MS to let public test their technology to see if it is
mature enough or usable before they will decide what
to do next with this crab

Cheers
Comment by AP [] on November 24, 17:41

Migrating from WinForms to WPF? 

As a former VB6 user who has now switched to Delphi, I 
swear I will never trust M$ again nor will I ever again 
experiment with their new products unless I am obliged 
to for commercial reasons.

Some years ago they left VB6 users stranded and tried to 
force them to switch to .NET taking into no 
consideration the millions of developers who had 
invested all of their energies in the .COM technology.

Now they want us to abandon WinForms and migrate to WPF. 
What for? What advantage would we get? Are they 
threatening to make native software stop working in 
their next version of Windows? How I wish ReactOS was 
not only a dream!
Comment by Pasquale Esposito [http://www.espositosoftware.it] on November 26, 18:27

Migrating from WinForms to WPF? 

 Pasquale - forget Microsoft, we have to live with 
what they ship but ignore them. I am more and more 
happy that my stuff runs under Linux or Apple. There 
is no beauty in Windows or Windows development. WPF is 
not bad if it fits... but honestly a VB developer in 
MS world is lost without Winforms maybe ASP.net and 
you are not the only one.

MS thinking works different, they kill the existing 
job role via introducing other human + tool 
combinations. Honestly, this is sthg. I don't honor. 
In the 90s it was ok, there was sthg. to show that 
Windows also can do ... but today this is on Apple and 
Linux today.

There is an asymmetry in the way humans and customers 
see the level of specialization. For a human it starts 
with IT -> (Developer,...) --> OS World. For Microsoft 
Windows is the world. For them it is important that 
someone knows the secret of Windows (a specific corner 
down the bottom) - just normal people say this is 
waste of time, make it work MS its your job. The 
techis see this different ... this is their world, 
they get sthg. new ... and the reason behind is simple 
- MS philosphy is and this too in the MS shops - pay 
your employees almost nothing but let them investigate 
technologies, this makes you finally dependent as a 
human. This is why just normal people don't understand 
what is challanging about WPF or Silverlight ... and 
btw. it is waste of potential. Think over ... I know 
Exchange Server ... What does this mean, nothing, this  
adds no value to nothing.

You said it - it is time for ReacOS:).
Comment by Michael Thuma on November 27, 20:45

Migrating from WinForms to WPF? 

WinForms is low-performance and requires too much
'work' on the part of the developer, then WPF and then
Silverlight came along and story is the same..
performance is still low, effort required on the part
of the programmer is high. Don't even talk about data
access, I don't see Microsoft doing anything good
regarding data access - LINQ? 

Microsoft should make open native software development
tools for Windows, something like Delphi, and get the
industry back on the right track. The software
development industry that is..

Regards,
Anonymous Coward
Comment by Anonymous Coward on December 7, 14:02

Another vote against WPF 

There's a summary of WPF against WinForms at this <a 
href="http://www.wiseowl.co.uk/blog/s245/winforms-
wpf.htm">web page</a>, written from the perspectives 
of a) a developer and b) a manager.  WPF is great if 
you're not the one having to bring the project in on 
time and within budget!
Comment by Andy Brown [http://www.wiseowl.co.uk/] on March 23, 15:39


Post Your Comment

Click here for posting your feedback to this blog.

There are currently 0 pending (unapproved) messages.