Great WinForms UI examples needed for inspiration - winforms

I am a systems analyst focusing on interaction design and usability, normally working on web applications (using my Mac). However, currently I am in a project team working on a legacy application which has a Windows Forms-based front-end.
I try to simplify and clean up the interface but given my web background it's quite frustrating to work within the strict constraints of WinForms and DevExpress 8.3 controls. (WPF would be great but it is not an option: the company has lots of off-shore users logged in remotely to virtual machines. WPF was tested several times and it failed. Windows XP and IE6 are still on all workstations.)
It would be great to see some good examples for elegant UI design for complex forms with lots of input fields in different categories and groups, including read-only sections with meta-data. It should not be fancy, just simple, slick and clean. Do you happen to have some good examples?

It looks like this post might give you some ideas/leads to pursue:
Where are examples of great program UI's built free with Winforms?

I still couldn't find real good ones, only sporadically. The best WinForms examples I found are in Windows XP itself and in other Microsoft products, like IE, Office.

This may be a long shot but have you considered using a metro-style layout (see wp7 et cetera)? I personally think it would be really well suited to forms with large data entry requirements, I mean, you have the spacing that will separate things perfectly for you, and it's all blocky so you know what you're doing.
This is just my opinion, but hope it can help!
With regards to being "restricted" to Windows Forms, I wouldn't see it as this. By creating your own custom controls you can do pretty much anything you want. I've always hand-coded my WF apps and they're always easier (not to mention more fun) to develop than in WPF. I think WPF is the restrictive place, but again that's just me... Haven't used it too heavily at all.

Related

Winforms perpective vs WPF. General question

I know such questions have been discussed here but have never seen them to be put it in this new light. We all know that WinForms isn't updated anymore by Microsoft. For client apps they are pushing WPF now. And people say WPF is harder to learn (I don't know, haven't tried really. And when I've tried I didn't much like it). But on the other hand, could that be it is just WinForms is perfect and there is nothing more to be done here?
WPF is in deed much harder to learn as WinForms. However it is really powerfull and gives you a lot of new possibilities. (I like the DataBinding-features and Templating really a lot).
WinForms on the other hand is very stable and is built on Win32. I'm sure it will be supported for a long time in future. But for me it's clear that microsoft will not extend the features if they have a new concept out there. Would you extend your old app, if you have a new one?
For me, I have switched already some years and I have never regreted the change. However, I have a lot of clienst with WinForms-apps, I built before and I don't have any hurry to update them to WPF. I never had a problem with WindForms, it is really a good and reliable product. As for your question: I think really WinForms is complete. It represents its time and has the features, this time had to offer. However, it's not perfect, no software can be perfect. Furthermore, I know also a lot of companies, developping new Apps with WinForms. MS will surely not letting die a technology for which so many apps exists. Look at XP, it will live longer than Vista.
Hard to learn is subjective.
I started learning winforms and WPF about the same time and I definitely feel more confident using WPF and feel I have picked it up quicker simply because I didn't have to "unlearn" winforms.
Sure, some WPF concepts are harder to understand at first but once they click into place you will start making progress and won't look back.
Saying that both technologies are great. Winforms Ace card is that it is mature, stable and easier to find help for.
Saying this, your question has a hint of "I'm not sure which one to choose so need someone to tell me" - The best advice is pick one and get on writing your application. Great applications can be written in both WPF and Winforms.
WPF is definitely better than WinForms, when you develop any LOB application its a high priority that how well you manage your code/project. When using WPF you have the power of following:
Separating your view from logic (the power of xaml, easier to read and design)
You can implement MVVM which gives you great control of your code. When working with multiple teams on a big project its a big plus.
On top of all that you can choose to use a framework like MVVM light, or use Prism 4.0 which not only helps implement MVVM but has other features too.
Another big advantage is, once you develop an application in WPF, you'll be able to develop in Silverlight with great ease. and with Silverlight 4 you have the capability of running your app out of browser without coding. Same app will run on desktop, cloud, web.
Finally I would say I wouldn't use WinForms because its 2011, WinForms is 90s...

Dxscene and VGscene with Delphi

I am using delphi as my primary development tool.
and recently I found these 2 libraries in KSDEV.com
and i found they are similar to WPF . So i just downloaded them and stated to playing with them until the time to end comes ( i have not checked its license policies yet). I am not a good WPF knowledge person but i found was WPF hard to develop.
But my doubt is , are these 2 libraries can replace WPF in delphi . what are the drawbacks Dxscene and VGscene have or what are the drawbacks WPF have ,
There are only a little articles about them in internet (google gave me millions of results but most of them repeated 2 articles which was published in KSDEV)
VGScene and DXScene can be compaired to WPF for the rendering result.
I think VG/DXScene are less resource consuming, and what I like against WPF, is that they are not XML-based.
You use regular Delphi components to define your UI.
But the learning curve and the documentation is still a bit lacking for VX/DXScene.
I found out to be a bit difficult to create forms with DXScene. VXScene is perhaps a bit easier to create your UI with the mouse.
I think the full power of these libraries will be obtained using code-generated UI.
I don't like the XML root of WPF. It's verbose, and difficult to work with, with real application with a lot of forms. For some projects, the external WPF designer could be necessary.
But don't ask Microsoft why they don't publish WPF-based applications... and they still use unmanaged code...
VgScene and DxScene are really cool libraries! You can make fast and nice looking GUI's with all kind of effects. It also has a grid component now!
But when I tried using them, I encountered some "drawbacks": there is little documentation how to make and what to use for a complex GUI (there are some nice demo's for simple GUI's though). So it has a relative high learning curve (when you only have VCL knowlegde because it is very different).
But besides these things, I think it is worth trying (only if you know how to do it and/or spend some time learning). It has good platform support (via FPC and OpenGL) so you can run it also on MacOs, Linux and iPhone/iPad!
Since they do not depend on WPF, they can be used for cross platform development in Lazarus/CodeTyphon. That is the main advantage for me. Drawback is documentation.

Are Windows Forms old tech?

It is time to write the GUI for my project, and I am wondering what technology to use. I did most of my .NET GUI development in .NET 1 & 2, so I know Windows Forms reasonably well. I am vaguely aware of WPF, but not yet attempted to "get into it".
Are Windows Forms dead or dying? Is WPF a good technology to learn? Is it the future, just a phase, or a technology that can walk hand-in-hand alongside Windows Forms?
Also, any experiences will be good to hear, especially from people who have used both extensively. How did you find implementing a similar feature in both frameworks?
Are WinForms dead or dying?
No. It is not significantly developed further (i.e. no new major additions), but it is fully supported in .NET 4, for example.
Is WPF a good technology to learn?
Yes.
Is it the future, just a phase, or a technology that can walk hand-in-hand alongside WinForms?
It is intended that you eventually move over to WPF, but it is also understood that there are large existing codebases written in WinForms, and there's no business case for rewriting them in WPF. Hence WinForms remains supported.
Also, any experiences will be good to hear, especially from people who have used both extensively. How did you find implementing a similar feature in both frameworks?
Broadly speaking, WPF is much more expressive. If you look at frameworks as set of Lego bricks that can be put together in various ways, WinForms bricks are much larger - each one does a lot - and therefore there are fewer ways to put them all together. Quite often, when you need something-but-not-quite like what an existing brick does, you have to write your own from scratch. In WPF, the bricks are significantly smaller, and can be combined in many interesting and even surprising ways.
For a concrete example, consider how WPF Button is a container that can host arbitrary content - not just image+text as in WinForms, but absolutely any other WPF control or set of controls.
WPF is also much easier to write dynamic layouts in compared to WinForms. The latter has layouts, too, but the problem is that they're a royal PITA to work with in visual designer, and writing WinForms component initialization by code is very tedious. With WPF, you just write XAML markup by hand, and layouts (and control trees in general) are very naturally represented in XML.
Partially stemming from the above, I find that WPF is easier to localize. For one thing, it's because you really do need dynamic layouts for localizability (since you don't know in advance the length of the strings in all locales). WinForms solution to this is to consider not only text labels, but also control position and size, as "localizable property" - so the translator is supposed to rearrange controls on the form himself if he finds that strings don't fit. In WPF, dynamic layouts are the default approach, so localizer just deals with strings.
WPF binding framework is rather powerful (even if verbose, thanks to lack of inline converters), and heavily promotes MVP, and, in general, model/view separation. This is possible to achieve with WinForms in 2.0+, and I try to do that there as well, but it's more tedious, especially with respect to null handling, and sometimes can be rather buggy.
One particular pain point is the way WinForms designer interacts with source control. There are two similar problems here. First of all, designer serializes edited form as code, and sometimes very minor changes in layout can make the designer generate completely different code (this is particularly noticeable if you edit toolbars) because it shuffles the code lines around - i.e. in reality it changed a single property value on one line, but it also reordered everything. This leads to very much noise in history (it's nigh impossible to tell what exactly was changed when looking at diffs), but more importantly, it means that merging such files is a major headache. This usually happens when two people work with the same form at the same time, and then one commits his changes, and the other one tries to commit, finds out that the file was changed in the meantime, tries to merge, sees the diffs, and jumps out of the nearest window.
A very similar problem happens when you use WinForms localizable forms, which pushes some properties to a resource file. Again, the designer very much likes to reorder property values in resource file for any trivial change, with all the same problems as described earlier.
Now as to deficiencies in WPF. A major one is that it's quite a bit more complicated, and may feel unfamiliar to someone with experience only with WinForms, VCL, VB, or other similar "traditional" frameworks. Another problem is that documentation, in my opinion, is not perfect - it usually gives a decent overview, but rarely covers corner cases, some of which can be pretty important. This is the case for WinForms, too, but there are fewer possible combinations there, so fewer corner cases as well.
There's also the issue of third-party components. WinForms had been around for a long time now, and there are plenty of those available for it, and a lot of them are very mature. WPF is comparatively young and still going through growth pains, and so do most third-party solutions for it.
One particular pet peeve of mine in WPF is the way it antialiases text - which is perceived as being of much worse quality compared to plain Windows ClearType by most people, especially on small font sizes; see this bug report for more info. This is fixed in WPF 4, but that isn't released yet, and even when it will be, chances are that you'll want to stick with the tried and true 3.5 SP1 for some time; and the fix isn't backported.
WinForms aren't dead or dying...they just can't provide the same User Experience that WPF can (without A LOT of work). They're just older technology.
WPF is a good technology to learn. It provides the ability to provide a much richer User Experience with less work.
The model for working with WPF is definitely different than WinForms. I've used both (WinForms more heavily than WPF/Silverlight) and the most difficult transitions for me were:
XAML, which isn't as bad if you have experience with another markup language like MXML.
DataBinding
Interface Event Handling (MouseOver effects, Timelines, etc.)
WinForms is far from dead/dying. WPF is simply a newer way to tackling the UI as it promotes things that were more difficult in WinForms. Things like separating the model behind the UI from the actual UI so it can easily be tested is a big factor.
It's definitely worth learning, but make sure to learn "the WPF way" of creating the screens rather than just fitting your WinForms-way into it. It's a different way of coding.
Perspective from 2016:
I don't often advocate chiming in on a question this old, but thought an epilogue may be appropriate on this one. Why? Because even now (2016), I hear developers in corporate environments still asking this question.
Yes, seven years later, WinForms is still alive in corporate environments, and still supported by Microsoft. Google Trends shows a slow, steady decline in interest since mid-2005, with current interest about one-third of 2005's.
WPF made a splash about 2009, but never fully took over as the de facto standard for new UI development. Google Trends shows WPF interest peaking from 2009-2011, then declining faster than WinForms. Current search interest is about half of 2011's, but still nearly double WinForms' current search interest.
So what ARE developers using now? Web-based UIs have exploded in popularity, largely due to the rise of mobile browsing. You could argue over the best way to go about writing a web UI (AngularJS + WebAPI? ASP.NET MVC? React? All are trending upward on Google Trends). Whichever technology you use, it's hard to deny the appeal of writing a (responsive) UI once and having it work on just about all devices and platforms. Cloud hosting services furthered the push to the web by offering virtually instant/infinite scaling with low up-front infrastructure investment.
So today, I'd heartily recommend moving toward a web UI, as it may improve the shelf-life of your app--which often need to last very long in corporate environments. Alternately, if you're a Microsoft-based developer doing mobile development, Xamarin is worth a look.
WinForms will probably be around for a long time to come in corporate environments. They work well enough for many purposes. Many projects are based on WinForms, and many companies will stick with that technology for the duration of projects rather than mix and match.
Having said that, WPF is the future. It is a much more efficient, much more capable UI technology and well worth learning.
WinForms and WPF can coexist in a single application. That will probably be the most common way for them to be introduced to a company (that, and small proof-of-concept projects).
Certainly not.
Winforms are easier to use (Considering you don't know WPF yet) and WPF is quite a departure from the Winforms model.
If you want a simple GUI (standard form stuff) go with Winforms. If you want something a bit more flashy and have the time, go for WPF.
I'm sure there will come a point in the future where WPF is the defacto standard. But for now, I stick with Winforms if I want something quick and clean.
It's worth mentioning that a lot of applications are already using Winforms - meaning maintenance work will often crop up involving WinForms, so don't rite it off just yet.
WinForms is not dead. Google "winforms C# jobs" and you'll find plenty. WPF is the hot stuff but it's still relatively new. It won't be mainstream for another two to three years IMHO.
Here is a good blog post about WinForms and WPF. The overall idea is to choose wisely, meaning that there isn't one winning over the other. Each have a different subset of features.
Making the decision between WPF and WinForms however is a different story. Sure, WPF is the new hotness and WinForms is old and busted but is it the right choice? Obviously "it depends" on the situation and Microsoft is continuing to deliver and support WinForms so it won't be going away anytime soon. So what are the compelling factors to choose WPF over WinForms? Karl hints at choices of WPF over WinForms in his WPF Business Application series, but the reasons might be subtle for some.
I personally prefer WPF because I started as a Web Developer and find the markup XAML to be more natural.
I think it's definitely worth learning WPF before it becomes more mainstream, it's always good to improve your skillset and to have experience and knowledge of newer technologies is always a plus, especially if WPF is to be more widely used in future.
Also, whilst writing xaml mark-up is very different to creating forms, it's not a million miles away from writing html and will probably not be too much of a departure for you if you've done any web development.
Whilst WinForms is an older technology that doesn't mean it will ever disappear though, we still have applications where I work that are written in VB6. Only half of our development department work with .NET - we're split into 3 teams, one team is still using .NET 1.1, another team is using .NET 2 and the team I'm on is using .NET 3.5 (you could say we're the lucky ones!)
We started using WPF for a new project and frankly, it's hard to go back to WinForms. Lots of neat stuff that I can't go withouh anymore.
One word of advice though. Even though you can do much more complex layout with WPF (like it's mentionned, a button, or almost anything really, can host other stuff like image, textbox and even more), some other 'basics' stuff found within WinForm are hard to reproduce.
Example : Before the WPF toolkit came out, WPF didn't have datagrids and datetime picker, so you had to do it yourself. Also, it still doesn't have MaskTextBox, you have to do it yourself or download it from third parties. Last one I ran into which I actually find annoting is with Treeview : the lines between leaves and parents doesn't show.
That being said, still much better than WinForm on most aspects.
we start using wpf in a new project we have
the new application includes a lot of legacy code in winforms.
whenever we want to use old dialog of winforms it is possible.
when you getr use to WPF you don't realy want to go back to winforms. it is just much more easy to do GUI stuff that woul take you lot of time in winforms.
any way it take some time to learn the stuff and be able to use all it's abilities (not just UI but also data binding and commands pattens).
having somone experienced that can help with first architecture can be very helpful.

WPF versus Windows Forms [duplicate]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.
Most restrictions and tricks with windows forms are common to most programmers. But since .NET 3.0 there is also WPF available, the Windows Presentation Foundation. It is said that you can make "sexy applications" more easy with it and with .NET 3.5 SP1 it got a good speed boost on execution.
But on the other side a lot of things are working different with WPF. I will not say it is more difficult but you have to learn "everything" from scratch.
My question: Is it worth to spend this extra time when you have to create a new GUI and there is no time pressure for the project?
After three months of trying to hammer out a line-of-business (LOB) application on WPF, I reached a point of considering turning back to Windows Forms for my project, and in researching other people's opinions, came across this thread...
Yes, WPF is a brilliant technology and it has benefits that span far beyond mere eye-candy... the templating and binding capabilities are great examples. The whole object model offers more flexibility and broader possibilities. That doesn't, however, make it the defacto platform for future LOB applications.
The "problems" which WPF solves in terms of separating GUI from business logic aren't problems which can't be readily solved in Windows Forms by simply starting with the right architecture and mind-set. Even the object-path binding capabilities of WPF can be reproduced in Windows Forms with some very simple helper classes. The data template capabilities of WPF are very nice, but again they're nothing that you can't simulate in Windows Forms on those rare occasions when you absolutely don't know exactly what objects you're going to represent on any given part of the screen.
Where Windows Forms races ahead is in terms of maturity. You can't swing a dead cat on Google without hitting some blog where someone has solved a Windows Forms problem for you. WPF, on the other hand, has comparatively less learning resources available, fewer custom controls available, and hasn't had as many of its teething problems solved.
At the peak of making a WPF vs Windows Forms decision has got to be the maturity of the development environment. Windows Forms editors are slick, responsive and intuitive. Feedback about errors gets to you instantly, the solutions are usually obvious, and the compile->debug->edit cycle in Windows Forms is very quick.
WPF applications, on the other hand, have comparatively pathetic design time support, with the design view all-too ready to chicken out at the first encounter of an error, often requiring a project build after the fix before the designer is willing to kick in again. Drag'n'drop of components from the toolbox might as well not be supported, given the vast range of circumstances under which it either doesn't work at all, or yields completely unintuitive results. Despite the promise of the WpfToolkit, there still isn't a usable DataGrid for WPF that yields any kind of resonable performance or design time friendliness.
Debugging WPF applications is a bit like the old ASP.NET debugging paradigm... hit F5 -> wait -> launch -> error -> stop -> fix -> hit F5 -> wait -> launch -> error -> groan -> stop -> fix -> hit F5.... All XAML which your program is running is locked, and tracking down XAML specific problems is often tedious.
The bottom line, simply put, is that the development tools for Windows Forms are going to have you banging out front-ends in a fraction of the time of a WPF application... especially if you're creating master-detail grids or spreadsheet like interfaces, which most LOB have. With Windows Forms, you start with 90% of the work already done for you.
I'm a huge fan of the WPF architecture. I just wish the design-time tool-set didn't feel like a pre-alpha debug-build.
Edit: This answer was posted about .NET 3.5 + Visual Studio 2008, but .NET 4.0 with Visual Studio 2010 ships with a WPF data grid. While many improvements have been made to the new WPF development experience, my answer here remains unchanged, and I'd like to add the following suggestion:
If you're in a rush to do RAD development, go with Windows Forms. If you're looking to produce a well architected, maintainable, scalable, resource firendly, multi-user Line-Of-Business application, consider ASP.NET MVC + HTML 5 + jQuery... My projects with these technologies have resulted in better outcomes, sooner, for my customers. MVC offers all of the same templating that WPF does, and jQuery enables animations and complex interactions. More importantly, an ASP.NET MVC + jQuery solution doesn't require your end users to have modern desktops with decent graphics hardware.
I'm seven months into using WPF on what has now become a core system for my customer, and I'd like to share some more thoughts with you about the experience of learning and using WPF as a line of business presentation platform.
In general, the comments I made above still hold... The design time support for WPF isn't here yet. If you're in a big rush to get a rich-client application out of the door, go with Windows Forms. Period. Microsoft aren't in any hurry to discontinue the GDI / Windows Forms platform, so you can count on good support for a fair time into the future.
WPF is not easy to master, but that shouldn't be where you leave your descision about whether or not to invest your time and energy into learning WPF. Despite its present lack of maturity, WPF is built around some useful, modern concepts.
In WPF, for example, your investment in well-written business objects with sound validating logic is a solid investment. Unlike Windows Forms, WPF's data binding is briming with features that allow interface controls to react to invalid user input without writing GUI code to detect those errors. This is valuable.
The styling and templating capabilities in WPF have proven to be valuable too. Despite the common misconception that the only use for styling and templating is to create on-screen eye-candy, the truth is that these features significantly simplify the coding of a user interface which gives rich feedback - like buttons that disable/enable themselves base on the state of the underlying business logic layer, or tooltips which intelligently find their text based on the state of the object under the cursor, etc.
These all add up to incredibly valuable features for "nothing fancy" business applications, simply because they make it easy to keep the interface congruent with the underlying data.
In a nutshell:
In Windows Forms you design your user
interface, then write code to drive
that user interface, which generally
also includes code to drive your
data objects.
In WPF you invest in the business layer that drives your data objects, then design an interface that listens to your data objects.
It's a seemingly subtle difference, but it makes a huge difference in your ability to re-use code... which begs the question: "Is the Windows Forms vs WPF question actually an investment decision?"
(This seems to have become my favourite thread.)
Are there any compelling reasons to use WPF
Absolutely! WPF is absolutely incredible! It will be a major benefit for practically any project because it has so many features and abilities that Windows Forms lacks.
For business applications the biggest wins will be:
The fantastic data binding and templating make the biggest difference. Once a decent data model is in place, it only takes a few clicks to create a data template and use Expression Blend to configure exactly how your object will look using drag-and-drop. And binding to things like color or shape is trivial.
Screen layout is incredibly flexible. Not only can everything in WPF smoothly adjust to container size and shape changes, but items can trivially be enlarged and rotated, and even extend outside their containing frame.
Ordinary objects can be presented any way you like, can easily have different presentations in different screens, can share presentation, and can adapt their presentation to changes in data values.
If you need to print, rendering to the printer is trivial. Properly configured, WPF makes Crystal Reports or SQL Server Reporting Services (SSRS) look like a child's toy.
Your user interface will look and feel much more dynamic, including nice features such as buttons that animate when you pass the mouse over them.
For utilities and games, other advantages come to the forefront:
You can easily add shapes, lines, and arbitrary drawings to your application without using an external editor. Every component of these can be data-bound and animated, or controlled by code. In Windows Forms you ususally just have to import a bitmap and use it as-is unless you want to go to a lot of work.,
Animations are cool! Users will be really impressed, as long as you don't overdo it. They can also help people see what is going on and reduce the need for hilighting. For example, when dragging an object you can animate the target to show what will happen if you drop it.
Colors, gradient fills, brushes, fancy fonts, rotation of any objects, tile brushes, etc. Anything you want graphically is yours for the asking.
Incredibly customizable. I needed to draw railroad tracks for one application, so I could drop a train on them. A couple of hours later I had railroad tracks I could draw anywhere on the screen using Bézier curves, and they would join and switch automatically.
The bottom line is that any significant-size GUI you could build in Windows Forms can be built in WPF in a third of the effort (or less) and look way, way better.
Does WPF require more resources (RAM in particular)
You do pay a price compared to Windows Forms, but it is a small one.
RAM can go up or down depending on your implementation. WPF stores its data more efficiently so individual objects are smaller, but there tend to be more objects in WPF than in Windows Forms so this balances out, and either one can come out ahead.
CPU will go up compared to Windows Forms. In my experience, the actual update of WPF objects onscreen takes about twice as much CPU as normal Windows Forms rendering. If your application spends most of its time updating the screen, WPF may not be for you. But in that case you're probably not using Windows Forms either: Most serious games are written directly to DirectX.
Disk usage will be slightly less for WPF because it takes so much less code than Windows Forms. The data will be the same size, of course.
One more note about CPU use: Animations and transforms (motion, translation, etc.) is actually more efficient on WPF than in Windows Forms because of its retained mode storage. It is the initial getting of the objects up there that is slower.
Maintenance overhead
WPF is a huge win over Windows Forms when it comes to maintenance. Since everything is done in 1/5 as much code as before, there is 1/5 as much to maintain. Plus all the boilerplate stuff is gone so you can focus on the code that actually does the work.
Benefits of XAML
XAML is the core of WPF. Although WPF can be used without XAML, XAML makes it incredibly easy to use. XAML has HTML's ability to easily specify a user interface, but its built-in tags are much more powerful, and you can easily define your own. (In fact, it is normal to do so).
Some specific advantages of XAML:
Your entire UI is defined in a text file that is easy to read and manipulate, both for users and tools
MarkupExtensions allow Bindings to be specified in a clear and simple way
Type converters allow properties with complex types to be easily specified. For example, you can say Brush="Green" or you can specify a radial gradient brush with three stops.
You can create your own elements
You can easily leverage WPF's powerful "attached properties"
Other insights
I dreamed of something like WPF for many years. Many people have implemented portions of this functionality, but to get it all in one place and at such a price ($0) is amazing.
WPF is a huge paradigm shift from Windows Forms and will take some getting used to, but the time spend learning it will pay itself back many-fold.
WPF still has a few warts even five years later, but its power will totally blow you away once you experience it. If someone tries to drag you back to Windows Forms, you'll only go kicking and screaming.
Tips:
- Do get a copy of Expression Blend for development
- Do edit XAML by hand occasionally
- Don't give up when it seems strange at first
WPF enables you to do some amazing things, and I LOVE it... but I always feel obligated to qualify my recommendations, whenever developers ask me whether I think they should be moving to the new technology.
Are your developers willing (preferrably, EAGER) to spend the time it takes to learn to use WPF effectively? I never would have thought to say this about MFC, or Windows Forms, or even unmanaged DirectX, but you probably do NOT want a team trying to "pick up" WPF over the course of a normal dev. cycle for a shipping product!
Do at least one or two of your developers have some design sensibilities, and do individuals with final design authority have a decent understanding of development issues, so you can leverage WPF capabilities to create something which is actually BETTER, instead of just more "colorful", featuring gratuitous animation?
Does some percentage of your target customer base run on integrated graphics chip sets that might not support the features you were planning -- or are they still running Windows 2000, which would eliminate them as customers altogether? Some people would also ask whether your customers actually CARE about enhanced visuals but, having lived through internal company "Our business customers don't care about colors and pictures" debates in the early '90s, I know that well-designed solutions from your competitors will MAKE them care, and the real question is whether the conditions are right, to enable you to offer something that will make them care NOW.
Does the project involve grounds-up development, at least for the presentation layer, to avoid the additional complexity of trying to hook into incompatible legacy scaffolding (Interop with Win Forms is NOT seamless)?
Can your manager accept (or be distracted from noticing) a significant DROP in developer productivity for four to six months?
This last issue is due to what I like to think of as the "FizzBin" nature of WPF, with ten different ways to implement any task, and no apparent reason to prefer one approach to another, and little guidance available to help you make a choice. Not only will the shortcomings of whatever choice you make become clear only much later in the project, but you are virtually guaranteed to have every developer on your project adopting a different approach, resulting in a major maintenance headache. Most frustrating of all are the inconsistencies that constantly trip you up, as you try to learn the framework.
You can find more in-depth WPF-related information in an entry on my blog:
http://missedmemo.com/blog/2008/09/13/WPFTheFizzBinAPI.aspx
WPF requires either Windows Vista or Windows XP SP2, which is not an onerous requirement, but it is a relevant one. If you want to run on Windows 2000 (which some people still do), then WPF won't work for you.
WPF is also a newer technology and not as proven as Windows Forms so you might choose Windows Forms as a less risky option, particularly for larger applications.
That being said, yes WPF is the future. Visual Studio 2010 is being rewritten in WPF, which will probably be the largest WPF application to date and it will also be a real test for the technology.
Obviously, legacy Windows Forms applications would be another situation where it is the correct choice.
As others have said, there are advantages and disadvantages either way you go here. The advantages of WPF, as others have said, include:
The ability to make very rich UIs relatively easily.
Easier animation and special effects
Inherent scalability (use the Windows Vista magnifier tool on a WPF application, and on a Windows Forms application: Note that in the WPF application, all the vector art scales beautifully)
(OPINION ALERT) I feel it's "easier" to do document-oriented systems in WPF
However, there are drawbacks to WPF, where Windows Forms comes out on top:
WPF's in-box control suite is far more limited than that of Windows Forms.
There's greater support in the third-party control space for Windows Forms. (That's changing, of course, but think about it: Windows Forms has been around since 2001; WPF just a few years. By advantage of time, Windows Forms has greater support in the community.)
Most developers already know Windows Forms; WPF provides a new learning curve
Finally, bear in mind that you can create great, attractive and engaging UIs in either tool, if you do the work (or use the right third-party tools). At the end of the day, neither is necessarily better in all circumstances. Use what feels right for the project.
The programming model for WPF is more open and flexible than Windows Forms is, but like ASP.NET MVC, it requires a little more discipline in terms of correctly implementing Model-View-ViewModel patterns.
My first LOB application with WPF ended up as an utter failuire, because it was a resource hog which brought my end-user's very-low-end laptops grinding to a halt... and this was ultimately because I just lept in with WPF + LINQ to SQL and expected a good result... and this is where WPF diverges so strongly from Windows Forms... In Windows Forms, you can get away with that sort of thing. WPF is much heavier on resources than Windows Forms, and if you don't architect your application to be lean, you end up with a 800-pound gorilla.
Don't shy away from WPF... explore it. But be aware that the acceptable sins of Windows Forms coding won't produce good results in WPF. They're fundamentally different engines, which lend themselves to fundamentally different coding patterns.
Last Word: If you do go ahead with WPF, get well acquianted with data virtualization for use with lists and grids. What is a simple data-bound ListItem or GridCell ends up being a hefty logical + visual object-graph in WPF, and if you don't learn how to virtualize, you application won't perform well on large data sets.
There is a very steep learning curve to WPF, and I recommend you get the obvious books first (Adam Nathan,
Sells/Griffiths, and
Chris Anderson) and
blogs (Josh Smith, etc.). Just be prepared for it, and make sure your project allows you the time to learn WPF.
In addition to learning the technology, spend some time learning the patterns used to construct WPF applications. Model View ViewModel (MVVM) seems to be the one that has gained a great deal of acceptance.
Personally, I think WPF is worth it but be forewarned. Also note that you effectively restrict your users to Windows XP SP2+ and Windows Vista. We've made that decision, but you may have some different requirements.
Both of technologies have their pros and cons. In a large application with a "classic" UI I'd use Windows Forms. In an application which require a rich user interface (skinning, animations, changing user interface) I'd choose WPF. Please check the article WPF vs. Windows Forms comparing WPF and Windows Forms.
Aside from the flexibility in UI design, there are some technical advantages to WPF:
1.) WPF doesn't rely on GDI objects. Well, I think it uses 2 GDI objects for the instance of the window itself, but that's practically nothing. I've been involved to a certain extent in a very large internal Windows Forms application. The people in our office sometimes run 3 or 4 instances of it simultaneously. The problem is that they frequently run into the 10,000 GDI object limit inherent to Windows 2000, XP and Vista. When that happens the entire OS becomes unresponsive and you'll start to see visual artifacts. The only way to clear it up is to close applications down.
2.) WPF utilizes the GPU. The ability for WPF to off-load some of the UI processing to the GPU is brilliant. I only expect this aspect of it to get better with time. As a former OpenGL programming hobbyist I can appreciate the power that comes from the GPU. I mean, my $100 video card has 112 cores running at 1.5 GHz each (and that's not top of the line by any means). That kind of parallel processing power can put any quad-core CPU to shame.
However, WPF is still pretty new. It won't run on Windows 2000. And in fact, a WPF application can be slow to start up after a fresh reboot. I talk about all of this on my blog:
http://blog.bucketsoft.com/2009/05/wpf-is-like-fat-super-hero.html
I think it is worth learning WPF. Once you are up to speed, design work on your forms is much easier IMHO. I wouldn't worry as much about the 'sexy' stuff. Most of this is just a fad. You can make 'normal' Winforms-style applications very quickly and easy in WPF.
The whole concept lends itself to easier design IMO.
I don't agree with some of the answers here. WPF is really well suited for line of business (LOB) applications. (The frog design LOB client is the best example). And besides all the possibilities to have your UI be eye candy (which is not necessary in business applications), WPF offers a lot more for you.
The data binding and templating features are just superior to Windows Forms. It also offers a far better way for separating code and presentation.
We've successfully used WPF for 2 LOB applications in teams with no more than 2-3 developers.
The biggest problem you will face is probably the steep learning curve of WPF (compared to Windows Forms) which will decrease development speed with developers not used to WPF.
We are currently rewriting our application in WPF from Windows Forms. Yes, there is a steep learning curve and you have to "re-learn" some things, but it is so worth it. And combined with WCF, we are finding we are writing less code, faster, and more robust than ever before.
Stick with it for a while, read Adam Nathan's book, and check out the ever growing library of third-party controls like those from Telerik and ComponentOne. One negative, in my view, is that the design tool, Expression Blend, is very awkward to use. The latest version is still in beta, but it just doesn't feel right to those of us who have used Visual Studio for years. Yes, it's mainly for designers, but some things you just can't do in Visual Studio.
Consider WPF if interface design is important to you, because WPF can deliver better UI experience. But Windows Forms has on its side the years of evolution, so it's proven to work and you can find many versed programmers for that platform.
Also portability may be an issue, WPF only works with Windows XP SP2 and up.
Also, WPF has a steep learning curve, meaning it's not easy to deliver a quality product without having specific WPF experience.
Well, one answer is "when you have to support 1.1 or 2.0", since WPF is part of .NET 3.0. There are known OS limitations for WPF, and there is an obvious skills issue: if you have a team of developers that know winforms, then it may be easier to turn out robust code with winforms. However, if you are writing a lot of UI code it is probably worth beginning to pick up WPF at some point.
WPF also shares a lot in common with Silverlight, so it has transferable benefits.
WPF comes with many advantages such as superb data binding features,
separation of concerns, separation of design and logic etc...
As a developer I enjoy the ability to define my UI using XAML as opposed to
being tied to the Windows Forms designer and I feel good knowing I can count
on another designer to make my app look good.
Personally I don't care older versions of Windows are not supported,
but one of the big problems with WPF is that is is not (currently/ever) supported
by Mono (http://www.mono-project.com) so WPF apps will not run on Mac OS or Linux.
(Altough Silverlight applications will).
If you have the time and resources to invest in learning WPF, do it!
Even if you're going to be writing Silverlight applications to support multiple OS's.
If you need desktop applications to run on multiple OS's stick with SWF.
There are many differences. We loved WPF for:
The declarative style of programming.
Animations and state transitions
Expression Blend is a great tool
Good style support.
However, we stuck with Windows Forms because:
The extra time it takes for a
developer to learn WPF when they
already know Windows Forms.
WPF will not run on Windows 2000 or
lower.
The biggest consideration when deciding which one to use is to consider what .NET Framework your target audience have installed. I find that more people have the lower .NET Framework versions that only support Windows Forms, but that's just my personal experience.
The advantages of WPF is that it is much easier to create nice looking GUI's with custom controls and animations. WPF also helps further serparate the presentation and logic layers. If you have designers, it allows you to farm of 95% of this work to non-coders and allows the coders to work on logic. The disadvantages are the software costs for Expressions Blend, and the lack of any of the Visual Studio code profiling tools working well as they tend to get caught up in the frameworks calls in trying to render XAML. I am sure there are others but these were the only two we really saw.
The main consideration is if you wish to require your customers to have to install .NET 3.0 or even better .NET 3.5 SP1. You will get some niegative feedback
WPF makes it much easier to hand off the forms design work to an actual designer, not a developer in designer's clothing. If that's something you'd like to do, WPF is your answer. If the classic Windows styled buttons are fine, then Windows Forms is probably the way to go.
(Multiple answers make the claim that you should use WPF if interface design is "important to you" but that's pretty vague. Interface design is always "important".)
If you have an MSDN license, check out Expression tools. It's designed explicitly for WPF, exports directly to Visual Studio and it may help ease your transition.
If you only care about supporting Windows and don't mind the time it takes to learn it, go with WPF. It's fast, flexible, easy to reskin, and has great tools to work with it.
As a side bonus, Silverlight is based on WPF and starting with either lets you gain the know how for working with the other. If things continue to go web based, having prior knowledge (and a library of existing code) to transfer easily to the browser (or Windows Live Mesh) might help give your software an extra lease of life.
If you decide to go with WPF, considering pros and cons already explained in the above answers, I highly recommend going through this dnrTV episode with Billy Hollis
In DotNetRocks episode 315, Brian Noyes discusses this extensively.
There is a known issue with text rendering in WPF. Many users report that the heavy use of anti-aliasing and pixel-blending used causes blurry text. This is a big deal breaker in some circumstances and, as far as I know, has been acknowledged by Microsoft at some level.
For the last 3 1/2 years I've been doing Windows Forms development (at two companies). Both applications were used extensively and ended up having GDI problems. Large Windows Forms applications will eventually run out of GDI resources - causing the end user to have to reboot.
Scott is complaining about Expression Blend and how it doesn't make sense to him as a developer. My first reaction to Expression Blend was like that. However, now I see it as an invaluable tool, but it really depends on what type of developer you are.
I am user interface developer that has had to perform the Integrator role, and I eventually found Expression Blend invaluable to create styles, and control templates in a WYSIWYG manner. I almost always have Expression Blend and Visual Studio up an running on the same project at the same time.
I also think that playing around in Expression Blend and taking a look at the XAML that gets spit out is an excellent way to learn the WPF API ... much like using the designer in Windows Forms and checking the C# code it spits out is helpful in learning how to use whatever you are designing there.
Expression Blend is helpful. Just give it a try, especially if you are working on the visuals for the application.
A quote from an earlier post from Mark:
In Windows Forms you design your user interface, then write code to drive that user interface, which generally also includes code to drive your data objects.
In WPF you invest in the business layer that drives your data objects, then design an interface that listens to your data objects.
I would argue that this is more of a design choice, rather than whether or not you are using Windows Forms or WPF. However, I can appreciate that certain technologies might be better suited for a particular approach.
Only if you don't have WPF expertise and you don't want to invest in it :)

Learn Silverlight or WPF first?

It seems that Silverlight/WPF are the long term future for user interface development with .NET. This is great because as I can see the advantage of reusing XAML skills on both the client and web development sides. But looking at WPF/XAML/Silverlight they seem very large technologies and so where is the best place to get start?
I would like to hear from anyone who has good knowledge of both and can recommend which is a better starting point and why.
Should you learn ASP.NET or Winforms first? ASP or MFC? HTML or VB? C# or VB?
Set aside the idea that there is a logical progression through what has become a highly complex interwoven set of technologies, and take a step back and ask yourself a series of questions:
What are your goals; how do you want to balance profit against enjoyment
Are you short term oriented or in for the long haul
Are you the type of person who likes to get good at something and do it a lot or do you get bored once you fully understand it?
The next and hardest step is to come to accept that any advice you are given is bound to be wrong; and the longer the time horizon the more likely it is to be incorrect. If the advice is for more than six to 12 months, the probability the advice is wildly incorrect approaches 1.
I can only tell you my story, quickly. In 2000 I was happy as a consultant working profitably in C++ on Windows applications, writing about ASP.NET and WinForms. then I saw C# and the world turned upside down. I never went back.
Two years ago I had the same kind of revelation, only an order of magnitude bigger, stronger and with more conviction about Silverlight. Yes, WPF is magnificent, and it may be that I'm all wet about this, but I believe in my gut that Silverlight changes everything. There was no doubt then and there is no doubt today that Silverlight is the most important development platform for Microsoft since .NET (certainly) and possibly since the switch to C++.
In a nutshell, here is why. I don't understand where its limitations are. With most platforms I do: you can do this, but you can't do that. WPF is a pretty good case in point, as was ASP.Net and WinForms and, well really everything until now.
With Silverlight, I don't see the boundaries yet. Silverlight has already leaped off the desktop onto phones, and I don't see any reason for it to stop there. Yes, it is true, it is bound by the browser, but I see that less as a jail cell than as a tank in which Silverlight will be riding over lots of terrain (it must be very late, I should go to bed).
In any case, for now, learning Silverlight is a gas, there is a lot of material on the Silverlight.net site, and what is the very best thing about learning Silverlight is that if you don't see what you need you can holler at me and I'll make sure you get it pretty quickly.
Enjoy, good luck and the dirty little secret is you'll be fine whichever you choose. It's all just software.
-jesse
Jesse Liberty
"Silverlight Geek"
I'd say go with Silverlight first!
I have programmed with WPF and Silverlight before.
But as Silverlight is a subset of WPF if you go in too deep and try to switch to writing Silverlight applications, you'll be scratching your heads looking for that "tag" you learned to love in WPF but is not available in Silverlight.
When you master the basic things in Silverlight first, the extra mechanism/trigger/whatever features in WPF will simply add to most of what you've already known.
Silverlight in WPF differs at the features level, not just some missing controls or animations. Take the WPF triggers mechanism for example, is not available fully in Silverlight.
So learning the smaller subset first, you can extend that knowledge to the full set later, but if you started at the full set and gets addicted to some of the niceties available, you'll have trouble down the line when someone asks you to port your designed-utilizing-WPF apps to Silverlight.
I'll go against the grain and say learn WPF first.
Here's my reasoning:
Much more resources are available for WPF than Silverlight, such as books, blogs, and msdn documentation
WPF Books
You're not dealing with a Beta, moving target
You don't have to deal with working with only asynchronous calls
Not limited by lack of features such as Merged Dictionaries, Triggers, TileBrushes, etc.
You don't have to worry about re-learning to do things correctly because of lacks of features in SL
Silverlight is a stripped down version of WPF so it should have fewer things to learn inside. On the other hand, the two platforms have different targets (web & rich client) so I guess it depends on what app you're going to build.
If you just want to learn for yourself (no app in the close future) I'd pick Silverlight because it would be less to assimilate. Still, Silverlight is pretty much a moving target, much more than WPF, so you'll have to keep up with some changes from time to time (the joys of being an early adopter :)).
WPF has lots more stuff that you will probably want to use at some point but I would wait for the needs to arise first.
Every industry expert I've heard on podcasts, blogs and interviews recommend learning Silverlight first and then gradually moving to WPF which is a huge UI framework.
Silverlight is light and allows you to work on smaller subset of controls and features such that you get your head around this new UI building paradigm based on,
Templating
DataBinding
Styles
Update: 07/2011
I hate to mention this, but in recent times Microsoft has put more focus on HTML5, Javascript and CSS by bringing forward powers of IE 9 and IE 10, as well as the upcoming Windows 8.
More and more developers and CTOs are skeptical about Silverlight as a LOB application platform as the time passes by, we are suspecting Silverlight will be limited to Windows Phone and niche, domain areas like healthcare of graphics related applications rather than a regular LOB app.
As it seems right now, as of summer 2011, the future might look fragmented with more opportunities for pure web technologies (HTML5, JS and CSS) as opposed to a plugin and OS-specific UI technology.
I would start by learning XAML, by reading a few tutorials and playing around with XAMLPad. This will give you a feel for the basics before actually building an app.
I would start with WPF and doing very simple control familiarizaton samples. You goal should be to learn XAML and Binding. So if you just create some basic WPF window apps will bootstrap your learning speed. Then eventually you can move to silverlight. Yeah as other mentioned here Silverlight is a subset of WPF.
Well, it depends on what you are going to be working on. If you are working on client/server, then I would go with WPF. If you are working in an environment where you can guarantee that .Net is installed on all of the machines, then I would go with WPF as well, because you can use what is called an XBAP, which is a WPF application that is run through the browser.
It's really up to you. However, I would state that silverlight is not RTM yet, and WPF is. WPF has a lot of books out on the subject, where silverlight does not. It may be easier to get the whole Zen of WPF by reading a few of those books, and then dive into which ever one you would like to play with.
Just keep in mind that silverlight has a subset of the controls of WPF, a paired down .Net framework, and does not do synchronous calls. As long as you know that up front, you can start learned the core of the whole foundation and tailor your practical experience later on to whichever technology is best for you.
Some tips at Getting started with Silverlight Development

Resources