Posted By: vesuvius | Jan 7th, 2008 @ 10:52 AM
page 1 of 2
Comments: 25 | Views: 4882
vesuvius
vesuvius
Das Glasperlenspiel

I have been engineering software for about 4 years now. For the most part I have used Windows Forms and ASP.NET (the latter being my focus hitherto).

Presently, I have a little sideline project, that may or may not be remunerative. This 'sideline' will be a smart client. The principal requirements for this project are two fold.

  1. A Microsoft Outlook type interface, with a grid control that has grouping.
  2. A grid control that is similar to uTorrent, Free Download Manager or FlashGet. This grid will have an array or progress bars.

Because this project, which I'll code name "Chronicle" is not commissioned, its is best met with free tools. At present it is in three incarnations.

  1. Using free components from http://www.componentfactory.com/. I have used just the free toolkit from here
  2. Using the exceptionally good components from Devexpress
  3. Using Windows Presentation Foundation

So far the need for the project to be free has ruled out Devexpress components because they are

  1.  Very expensive
  2. Add additional layers of complexity to the project. Just try to get you head around the Xtragrid, their version of the data grid view. This is not a pleasant experience, and comes at the expense of a few months to master.

The two left, are the Windows forms application with Krypton, or WPF.

I was asked this question by Sabot a while ago;

What drives change in your organisation? Technology or Business requirement?

I have since struggled to answer it. Business requirement tells me the winforms is the way to go, but WPF makes things so much easier. Trying to embed controls like progress bars into data grid views requires some tricky code. The winforms data grid view has a flickering problem, basically I'm fighting the tools here.

To get a faithful Outlook UI in winforms, there is the Joe Stegman sample titled Building Outlook UI in 100 lines of code with Winforms (link to the video on channel 9). This is probably the canonical example for doing this type of thing in winforms. Only problem is these is no grouping in the datagrid, that has been heavily modified. In WPF you just set a few properties to a Listview control.

To get a faithful Outlook UI in WPF, there is this example. Both examples lack the WOW and exact finish that Devexpress or Infragistics components have. But they teach you the principles, you can iron out your business logic, then either be creative or purchase presentation layer components.

In WPF you can add any control into any control, a huge obstacle to my project in windows forms.

In WPF to enable spell checking you do this;

<TextBox SpellCheck.IsEnabled="True" />

In windows forms you either go with Netspell (4 years old) or this, which does not work on my PC because I'm using office 12. More tweaks required there then.

What would you do? Which way would you go?

W3bbo
W3bbo
The Master of Baiters
vesuvius wrote:
What would you do? Which way would you go?


Going by these examples, I'd use it as an excuse to give WPF a good airing and seeing if it lives up to the hype.
Minh
Minh
WOOH! WOOH!
vesuvius wrote:
What drives change in your organisation? Technology or Business requirement?
That's a trick question Wink There's only one answer to the question above.

The real question is "How big is your organization?"

How quickly can you update all your desktops to Vista / or install .NET 3.x?

CannotResolveSymbol
CannotResolveSymbol
{insert caption here}
vesuvius wrote:

What business is it of mine to foist Vista based solutions, when Winforms will do? They are unlikely to pay more for one or the other. Resolve their business needs, and laugh all the way to the bank. Look at the Microsoft Dynamics suite, thats based on Office 2003, never mind the shnazy Office 2007 UI.

I'd prefer to maintain a XAML based app though, in the long run.


This isn't really a vista-based solution, though.  You can do everything with WPF/.Net 3.0 in XP that you can with Vista, so there's no extra cost beyond the time it takes to learn the new APIs.

I say, if it suits your needs, use it.  Distribution of .Net 3.0 is what WSUS and Group Policy is for, so unless you've got really limited resources, run with it.


Minh
Minh
WOOH! WOOH!
CannotResolveSymbol wrote:

This isn't really a vista-based solution, though.  You can do everything with WPF/.Net 3.0 in XP that you can with Vista, so there's no extra cost beyond the time it takes to learn the new APIs.

There's a real cost either upgrading to Vista / or simply installing .Net 3.x if your company has 1,000, or 10,000 etc.. desktops.

There are security & compatibility concerns that the head IT guys are gonna have to OK before they do that.

And that's if it's YOUR company.

If you're trying to sell a product to a company & you say, oh, and the requirement is you install this redistributable on all 10,000 of your desktop, don't be surprised if you get a call back.
The same could be said for Windows Forms though, just a different version of the .NET framework redistributable that you'll have to publish.  Now a Vista upgrade for an entire company is an entirely different story; I couldn't agree with you more there.
TommyCarlier
TommyCarlier
I want my scalps!
How is this the death of Windows Forms? I work in a small company (currently 2.5 developers) and we've been writing WinForms applications for years now. I've investigated WPF as an alternative and we've decided to stick with WinForms. There's no point in discarding years of experience just to try out a new exciting technology that is far from mature.

Some of our applications use a UI that is a bit Outlooky (though far from the same). We use the free Krypton Toolkit, the commercial Krypton Navigator and the Xceed Ultimate Suite (contains Xceed Grid, Xceed Compression, Xceed Zip, Xceed Ftp, ...).

Here's a screenshot of the main window of one of our applications:
Screenshot of Transceiver Communicator main window
TommyCarlier
TommyCarlier
I want my scalps!
Vesuvius, you can follow the progress like you can in Outlook: when the app is sending or receiving files, you get a button in the status bar that says 'Sending/Receiving...'. If you click it, you get a window with the files that are being sent or received, with progress bars in the list. You're right that you have to do some work in WinForms, but it's not that hard. Our grid is actually not the default DataGridView, but a highly customized version of Xceed Grid. It has better performance and more capabilities (also better extensibility).

You are also correct that the primary function of Transceiver Communicator is to send and receive files. We tried to optimize and simplify the UI so that primary function has the main focus. In the latest version we've restructured the UI of the main window considerably. We moved some of the secundary functions (Address Book, Account Settings, ...) to menus to reduce the visual noise of too many buttons.
Sven Groot
Sven Groot
My name has 9 letters. Coincidence? I think not...
vesuvius wrote:
What is a vista based solution? I am beginning to find that there is huge value in just using WPF to perform some tasks that Winforms does, simplly because it's easier. Not because I have transitions, carousel views and all the visual efects. I am championing WPF purely from an implementation point of view.

I agree, WPF is a powerful tool even for simple UIs, especially the databinding.

I just wish it wasn't so slow. In one scenario I was trying recently I have a country selection dropdown which has 217 items. This works fine in WinForms (which is the basic Win32 combobox), even on slow computers. In WPF, opening and scrolling the dropdown is painfully slow even on a Dual Core system with a high end videocard. That is quite frankly rediculous.
littleguru
littleguru
<3 Seattle
It's not an easy decision. We had to face it 1 year ago too. WinForms or WPF. We went with WinForms because we had to support PCs that were of older age (like old GPUs and CPUs) and wanted the app to run on them fast too.

I was actually surprised how easy you can write your own custom controls by just overriding a few methods - like OnPaint etc. We customized everything where needed and didn't buy any 3rd party (expect the reports generator).

The whole project was done in like 1.5 months (2 people). We would have needed more in WPF because that would have been completely new to us.

My suggestions, if you go with WinForms, is to try to write as much as you can on your own and don't go to much with 3rd party, although you really know how to extend them. Otherwise you probably end up in a death end and you think you should have gone with WPF because that would have been easier to extend. Also try to think in components. Try to build components if you can and reuse them.

If you go with WPF you probably have to write most on your own because there aren't much components around and if they are they aren't probably very mature. Still writing own components (or even customizing existing) is simple in WPF.

edit: you should check out WPF sooner or later anyway. It's probably going to be the standard in the future... probably.
Sven Groot
Sven Groot
My name has 9 letters. Coincidence? I think not...

I would suggest you pick a small, unimportant product to get a feel of WPF before committing to using it on something substantial.

I would also recommend in any case to design your product with a clean separation between UI and functionality (trying to do as much as possible with data binding pretty much achieves that by default), that way you can always decide to create a WPF UI later on.

Sven Groot wrote:
I agree, WPF is a powerful tool even for simple UIs, especially the databinding.

I just wish it wasn't so slow.
A WinForm has its limits, too...or should I say, GDI+ has its limits. I tried building a terrain design tool recently using C# and WinForms. 

Drawing hundreds of grid lines on a panel component (don't ask) = slow window repaints
littleguru
littleguru
<3 Seattle
Sven Groot wrote:
I would suggest you pick a small, unimportant product to get a feel of WPF before committing to using it on something substantial.

I would also recommend in any case to design your product with a clean separation between UI and functionality (trying to do as much as possible with data binding pretty much achieves that by default), that way you can always decide to create a WPF UI later on.


This is a great advice. I couldn't have said it better! Way to go!!
littleguru
littleguru
<3 Seattle
thumbtacks2 wrote:

Sven Groot wrote: I agree, WPF is a powerful tool even for simple UIs, especially the databinding.

I just wish it wasn't so slow.
A WinForm has its limits, too...or should I say, GDI+ has its limits. I tried building a terrain design tool recently using C# and WinForms. 

Drawing hundreds of grid lines on a panel component (don't ask) = slow window repaints


There is a way to only repaint what has been updated - also in GDI+. You even get that in the methods that you use when painting the control... That should make it way faster.

Still GDI+ has its limits. That's for sure. If it wouldn't have WPF would have never been needed. If you have 3D stuff or things that involve a lot of graphics and animation you probably want to go with WPF.
Minh
Minh
WOOH! WOOH!
thumbtacks2 wrote:
A WinForm has its limits, too...or should I say, GDI+ has its limits. I tried building a terrain design tool recently using C# and WinForms. 

Drawing hundreds of grid lines on a panel component (don't ask) = slow window repaints
Looked at XNA yet?
Minh wrote:
Looked at XNA yet?
Not yet...maybe next year. Big Smile

I have built a model loader, a basic animation tool (related to path animation), and have the terrain tool partially built. I did look at some other terrain generation programs that were out there, but they don't really seem to match what I'm looking for. Although Speedtree might be helpful. (I know...I'm taking the long way...)
Minh
Minh
WOOH! WOOH!
thumbtacks2 wrote:

Minh wrote:Looked at XNA yet?
Not yet...maybe next year.

Definitely, a XNA 3D port control will be embeddable in a WinForm will be ready for you by then. Although, you can hack it already now.

thumbtacks2 wrote:

I have built a model loader, a basic animation tool (related to path animation), and have the terrain tool partially built. I did look at some other terrain generation programs that were out there, but they don't really seem to match what I'm looking for. Although Speedtree might be helpful. (I know...I'm taking the long way...)
What are you building?
page 1 of 2
Comments: 25 | Views: 4882
Microsoft Communities