Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Migrating from Windows Forms to WPF... was it worth it?

Tags:

winforms

wpf

I also have a desktop application written in Windows Forms that is a middling size (a couple dozen major forms backed by 46 tables in the database). I'm thinking about rewriting the UI in WPF, but before I go there I was curious if there were any war stories about doing such a conversion.

I use LLBLGen to generate my low level data access objects, and I have a business logic layer above that. The forms are databound to the business logic objects, although the main form uses caching objects to minimize round trips on the more common navigation routes. The UI never speaks directly to the database: always through the UI -> business logic -> low level -> datastore path.

One control that I use heavily is the TreeView, which acts as a visual guide and short range navigation tool. The tree has been heavily customized with icons, highlight colors and it is the control I worry most about porting.

Is there a story that might convince me to go ahead and convert (or conversely, wait until Microsoft is closer to pulling the rug out from under Windows Forms)?

EDIT: I was asked in a comment what motivation for conversion I have. I have some concern about future proofing: I have 500,000 lines of code that were originally ASP and VBScript. We have been porting the functionality over time to ASP.NET and C#, but only as we make changes to the code. The upside is we have kept costs minimized, the downside is half the code remains ASP and VBScript. I'm concerned about a similar situation arising with Windows Forms applications.

Am I worried today about Windows Forms going away? Not even close to it... but the application is moving from ASP and VBScript to ASP.NET and C#, has nine years of history behind it, and probably won't be replaced this decade (instead, simply it will evolve). The desktop application is likewise a long term project with years of history.

like image 351
Godeke Avatar asked Feb 10 '09 21:02

Godeke


People also ask

Is WPF better than Windows Forms?

Winforms vs WPF both are mainly used for the same purpose for developing and designing windows applications, but WPF can be used for the web application. The difference between them is scalability, performance as WPF can render fast compared to windows forms, complexity, and support.

Is WPF still relevant 2021?

WPF is still one of the most used app frameworks in use on Windows (right behind WinForms).

Why we use WPF instead of Windows Forms?

Advantages of using WPF instead of Windows forms: XAML makes it easy to create and edit your GUI, and allows the work to be split between a designer (XAML) and a programmer (C#, VB.NET etc.). It allows you to make user interfaces for both Windows applications and web applications (Silverlight/XBAP).

Is WPF harder than WinForms?

It is simple to use WinForms as controls can be used easily, it's less time-consuming and less tricky as compared to WPF.


1 Answers

For me, the WinForms vs. WPF decision is a simple one - if normal people are going to use it, the user interface can make the difference between a winner and a loser.

It is definitely a steep learning curve. But I have NEVER gotten done with a nice looking WPF application and said "Man, I should have used WinForms".

I'd say invest in the effort to make your UI better whenever possible for your customers, so yes to WPF if that's the case.

like image 102
Brandon Avatar answered Sep 19 '22 05:09

Brandon