Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Windows Forms vs. WPF
Message
General information
Forum:
ASP.NET
Category:
Windows Presentation Foundation (WPF)
Environment versions
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01431881
Message ID:
01432113
Views:
41
You do not need a designer. But, mind you, it is easier to make awful UI in WPF than Winforms.

From WPF in Action:
Speaking about Winforms: "If you see a dialog with some text, a text box, and a couple of buttons you're probably looking at five windows. Each window is responsible for painting itself. If you drag something over the top of the dialog and then move it, WIndows doesn't remember what that dialog looked like. It sends a message to each window within the dialog, telling them to repaint themselves."

You can see this happen. Load up lots of CPU intensive processes then drag a window around. You'll see ghosts of where the window was as each window waits for it's turn to be told to repaint itself. WPF doesn't do things the old way. It's more efficient in how it manages things on the screen. If you have a bunch of WPF forms and move one around, the ones underneath refresh correctly.

"When the application is told to paint something, it works with a device context. Once you draw a circle on a device context, it's no longer a circle, but a bunch of dots with color values."

In WPF, when you draw a circle, you get a circle, not a series of dots. It doesn't matter if you're talking about a circle or a straight line. The old way was a series of dots, which is why things became pixelated at higher resolutions. WPF uses vector graphics to draw things, including fonts. You can scale a font from 1 to 200 points and still looks good.

"Programming Windows UI is often about figuring out how to do things. At the same time that Windows development was maturing, the World Wide Web came into being. On the web, everything was about what you wanted to say, with the details of presentation left to the browser. As the web developed, more and more effort went into controlling how that content was presented."

WPF follows the web way by concentrating on the how. I'm not going to say this is better or worse. But, it helps bring Windows apps closer to web apps.

"Today, many machines ship with their DPI set to 120, instead of the standard 96 DPI to which most applications have been developed. Winforms and other technologies play tricks to try to make things look the same when changing DPI. But it doesn't work all that well. It's not uncommon for applications to wrap text strangely or had oddly sized text. These advantages don't take advantage of the better equipment; instead of having a sharper UI, the UI just gets smaller"

"WPF has a clean approach for the DPI problem. WPF uses device independent units (DIPs). There are always 96 pixels to an inch. If the DPI setting of the target device changes, everything is scaled up or down."

>Efficiency - specify what efficiency. I'm hearing how you need a designer to do the XAML part and a coder to do the codebehind (here come the committees). I'm hearing it needs better hardware. I've seen that it takes longer to build an interface (compating apples to apples). Prove that efficiency improves and I'll listen a lot more.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Reply
Map
View

Click here to load this message in the networking platform