Is WPF really *this* lacking, or am I just an idiot?

  • (2 Pages)
  • +
  • 1
  • 2

16 Replies - 8476 Views - Last Post: 18 January 2012 - 07:09 AM Rate Topic: -----

#1 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5678
  • View blog
  • Posts: 12,213
  • Joined: 02-June 10

Is WPF really *this* lacking, or am I just an idiot?

Posted 16 January 2012 - 01:47 AM

Ok, I've spent the last 7 weeks of comp-time off from working pretty much dedicated to learning WPF and Expression Blend Studio 4.

But I have to say that every time I go to build a fairly simply form window and put a little functionality behind it I find something else that doesn't exist in WPF.

No NumericUpDown
No common dialogs like FolderBrowers, FileBrowser, SaveFileDialog, OpenFileDialog

How do people build even basic learning projects without the ability to browse to a file, or select a folder to be used?

How long has WPF been out now? For some needs you can access the Win32 version: [sarcasm]That's a real compelling reason to use WPF.[/sarcasm]
Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();
dlg.DefaultExt = ".txt";
dlg.Filter = "Text documents (.txt)|*.txt"; 
if (dlg.ShowDialog() == true )
{ 
   string filename = dlg.FileName; 
}


I feel like I've failed to install some WPF controls library update or some such. Is there a controls library that brings the base level of WPF up to at least the base level of WinForms? I've done every on-line update and nothing is available. I've done a lot of searching and there are various 3rd party and open project libraries, but I'd really rather be using the Microsoft standardization to start with, if they exist.

Now don't get me wrong, I've seen and done some cool things in WPF as part of my education. I think its great to be able to define application-wide styles and brushes. Makes skinning an app much easier. And the binding features are pretty cool when you get a feel for them. But my boss with have my guts for garters if I tell him that in order to go WPF we are first going to have to re-invent 20-50% of the controls that ship with WinForms.

WinForms <-> WPF control equivalents
Looks like a lot of missing things commonly used - To me anyway.

Is This A Good Question/Topic? 0
  • +

Replies To: Is WPF really *this* lacking, or am I just an idiot?

#2 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1526
  • View blog
  • Posts: 5,961
  • Joined: 21-March 08

Re: Is WPF really *this* lacking, or am I just an idiot?

Posted 16 January 2012 - 05:48 AM

I'm not really sure what you conceive the problem is with the OpenFileDialog. The Microsoft.Win32.OpenFileDialog is the correct one to use in WPF4. So what problem do you have with using this one? If functions exactly the same(as far as I can tell) as the class from WinForms.

This is the same for the SaveFileDialog and the OpenFileDialog. The only one that is missing is the FolderBrowserDialog, which you could simply use the one from WinForms(add a reference to System.Windows.Forms), or use one of the open source options.

As for other controls you may be missing, check out the WPF Toolkit and the WPF Extended Toolkit.
Was This Post Helpful? 0
  • +
  • -

#3 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1526
  • View blog
  • Posts: 5,961
  • Joined: 21-March 08

Re: Is WPF really *this* lacking, or am I just an idiot?

Posted 16 January 2012 - 06:09 AM

Going down that list:

BindingNavigator - With the way binding changed in WPF, don't know if this was needed
ColorDialog - In the Extended WPF Toolkit
ErrorProvider - WPF handles data validation differently(better IMO), so this isn't needed.
ImageList - Since basically all control templates are customizable, you can make a ListBox into an ImageList very easily.
FontDialog - Fonts changed in WPF. Not sure why there isn't a dialog though.
LinkLabel - Hyperlink can be used in it's place
MaskedTextBox - in the Extended WPF Toolkit
NotifyIcon - I think you can still use the WinForms one...or the many that have been created by others.
PageSetupDialog - Should be able to use the WinForms version.
PrintDocument - Should be able to use the WinForms version.
PrintPreviewDialog - Should be able to use the WinForms version.

And you may say, "why should I have to use the WinForms version in WPF?". Think about it. Those dialogs are showing dialogs from Windows. That isn't going to change between WinForms and WPF. It would have been a waste of time to write a control that did the exact same thing in WinForms for WPF.
Was This Post Helpful? 0
  • +
  • -

#4 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5678
  • View blog
  • Posts: 12,213
  • Joined: 02-June 10

Re: Is WPF really *this* lacking, or am I just an idiot?

Posted 16 January 2012 - 09:34 AM

Ok. I bow to the experience of those that have done WPF for a while.

It just feels like a kludge to me. Some parts are WPF. Some parts are pulled from WinForms... Oh, there are these entension packs from codeplex... and for the rest search the net for some work that someone else shared with the world to fill the gaps where obvious needs exist.

Color me simpleton, but I would have expected this masterpiece called WPF that is supposed to take over how we build applications to at least have matched all the controls in the basic Visual Studio toolbox. Even if they are just wrappers around the WinForms controls at least you're not working 5 different base namespaces.

But ok, its Microsoft. Just like when I started learning C++... "I surrender. I accept what I cannot change. More time coding; less time bitching."
Was This Post Helpful? 0
  • +
  • -

#5 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5678
  • View blog
  • Posts: 12,213
  • Joined: 02-June 10

Re: Is WPF really *this* lacking, or am I just an idiot?

Posted 16 January 2012 - 09:43 AM

View Posteclipsed4utoo, on 16 January 2012 - 07:09 AM, said:

And you may say, "why should I have to use the WinForms version in WPF?". Think about it. Those dialogs are showing dialogs from Windows. That isn't going to change between WinForms and WPF. It would have been a waste of time to write a control that did the exact same thing in WinForms for WPF.


I just figure when new technology comes out it should actually be an UPGRADE. Have you looked at the BrowseFolderDialog? It sucks! It's right out of Win95. The MS one doesn't even have a textbox where you can type in a path, or see the full path selected... No left-side panel to quickly jump to common places like Computer, Documents and so on. It totally does not have the same look and feel as the FileSaveDialog and FileOpenDialog.

Attached Image

Attached Image
Was This Post Helpful? 0
  • +
  • -

#6 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1526
  • View blog
  • Posts: 5,961
  • Joined: 21-March 08

Re: Is WPF really *this* lacking, or am I just an idiot?

Posted 16 January 2012 - 11:51 AM

View PosttlhIn`toq, on 16 January 2012 - 12:34 PM, said:

It just feels like a kludge to me. Some parts are WPF. Some parts are pulled from WinForms... Oh, there are these entension packs from codeplex... and for the rest search the net for some work that someone else shared with the world to fill the gaps where obvious needs exist.


The toolkits are for additions made to WPF without the need for a full framework release or service pack releases. This occurs in Silverlight and WP7 also. It's a way for Microsoft to add functionality into WPF that didn't make it the 4.0 release outside of the regular release schedule for WPF. I love it like this. Instead of waiting years between new controls, we can get them in a few weeks/months.

Question to you, you would want to waste your time on creating a new class, even though it will function EXACTLY the same as the old class? What's the purpose of that? To simply say you "rewrote" it?
Was This Post Helpful? 0
  • +
  • -

#7 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1526
  • View blog
  • Posts: 5,961
  • Joined: 21-March 08

Re: Is WPF really *this* lacking, or am I just an idiot?

Posted 16 January 2012 - 12:05 PM

The FolderBrowserDialog is not suppose to be copies of the OpenFileDialog and SaveFileDialog. The "ugliness" of the FolderBrowserDialog has nothing to do with WPF. IT'S WINDOWS!!! Go to IIS and create a new Virtual Directory, and in the dialog, hit the button for the folder browser. Wow...that looks exactly the same as the one you posted. But wait, why would IIS show that SAME FolderBrowserDialog? As far as I know, the IIS manager app is not written in WPF.

Oh wait..wait...I just created a WinForms app and used the FolderBrowserDialog, and it's the same way.

So why again are you complaining about the "WPF FolderBrowserDialog" when it's really the Windows FolderBrowserDialog that you should be complaining about?

View PosttlhIn`toq, on 16 January 2012 - 12:34 PM, said:

Color me simpleton, but I would have expected this masterpiece called WPF that is supposed to take over how we build applications to at least have matched all the controls in the basic Visual Studio toolbox. Even if they are just wrappers around the WinForms controls at least you're not working 5 different base namespaces.


I don't know who told you WPF was a masterpiece and would take over how we build applications, but if this is really your attitude, then maybe you shouldn't worry about WPF. Just go back and tell your boss that it sucks and stay in WinForms until Windows 8.
Was This Post Helpful? 0
  • +
  • -

#8 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5678
  • View blog
  • Posts: 12,213
  • Joined: 02-June 10

Re: Is WPF really *this* lacking, or am I just an idiot?

Posted 16 January 2012 - 12:50 PM

View PosttlhIn`toq, on 16 January 2012 - 10:34 AM, said:

But ok, its Microsoft. Just like when I started learning C++... "I surrender. I accept what I cannot change. More time coding; less time bitching."

Was This Post Helpful? 0
  • +
  • -

#9 bflosabre91  Icon User is offline

  • go sabres

Reputation: 105
  • View blog
  • Posts: 1,439
  • Joined: 22-February 08

Re: Is WPF really *this* lacking, or am I just an idiot?

Posted 16 January 2012 - 12:57 PM

I know it can be a lot of work but a lot of those can be made into your own usercontrol, which I'm sure you are aware of. I also thought the folderbrowser looked absolutely ridiculous, so i figured it was worth my time to create my own usercontrol with all the same functionality which is wicked easy to do in WPF.
Was This Post Helpful? 0
  • +
  • -

#10 Frinavale  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 203
  • View blog
  • Posts: 776
  • Joined: 03-June 10

Re: Is WPF really *this* lacking, or am I just an idiot?

Posted 17 January 2012 - 12:17 PM

You can't skin a WinForms window. I know it sux but it does make sense: they're two different technologies.

But you can create your own WPF File Dialog and skin that :)
I wonder if there's a codeplex project for a WPF File Dialog...

I have created my own dialog window (it's just a window with nothing in it) It has a style property and I bind to whatever I want to display in a "dialog" (this is usually a ViewModel). The style is used to display the data it's bound to and it works pretty well :)

>>off to go snooping codeplex<<

-Frinny
Edit: PS I too think that the lack of a numeric up down is a lack of foresight on the part of MS...I'm constantly changing my custom numeric/time control because I can never get it quite right

This post has been edited by Frinavale: 17 January 2012 - 12:24 PM

Was This Post Helpful? 0
  • +
  • -

#11 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5678
  • View blog
  • Posts: 12,213
  • Joined: 02-June 10

Re: Is WPF really *this* lacking, or am I just an idiot?

Posted 17 January 2012 - 01:11 PM

Thank you for helping me think I'm not the only one.

Skinning is one of the reasons we are shifting to WPF.

Just one example:
We have clients that have sales stations in caves. (Cave tour route as part of the eco-tourism adventure park). They would like to have the look of the sales software be more in-line with their overall look. Red, browns, earthtones... Textured or bitmap backgrounds to give the windows a rocky feel... Screens that aren't wildly bright because the operators are constantly shifting their gaze from monitor to guest...



Also, customizable standard dialogs like open/save/browse allow developers to do things like limit where a user can go. Sales staff don't need to be able to browse the entire PC. They need to be limited to just the USB drive they are selling product on for example.
Was This Post Helpful? 0
  • +
  • -

#12 RexGrammer  Icon User is offline

  • Coding Dynamo
  • member icon

Reputation: 182
  • View blog
  • Posts: 783
  • Joined: 27-October 11

Re: Is WPF really *this* lacking, or am I just an idiot?

Posted 17 January 2012 - 01:12 PM

View PosttlhIn`toq, on 16 January 2012 - 04:43 PM, said:

Posted Image


Das ist XP. Blast from the past! :rockon:

Although I agree with you to some extent (I expected WPF to have at least the same number of controls, and then plus some extra), I can't say WPF is lame. Have you tried data-binding in WPF, it's epic! Also you can't define a style for a WinForm can you... WPF just has more interesting functionalities that WinForms don't. At the very least, you have great interopterability between WinForms and WPF, and you can use all WinForm controls in WPF. This is all if we forget the multimedia capabilities of WPF and 2D & 3D graphics in WPF, which is one of the main perks of WPF.

I expect the next release of WPF to be what was expected of WPF in the first place.

There are alot of articles type of 'why is WPF better than WinForms' on the web, but one of the most complete and correct ones is:
10 reasons you should consider WPF for your next desktop application

@FrinavaleI always use WinForms/WPF interopterability and use the WinForms numericUpDown.

This post has been edited by RexGrammer: 17 January 2012 - 01:15 PM

Was This Post Helpful? 0
  • +
  • -

#13 lordofduct  Icon User is offline

  • I'm a cheeseburger
  • member icon


Reputation: 2538
  • View blog
  • Posts: 4,641
  • Joined: 24-September 10

Re: Is WPF really *this* lacking, or am I just an idiot?

Posted 17 January 2012 - 02:00 PM

I feel ya tlhIn'toq. When you first start off with WPF, it feels lacking. It turns out after digging you find tons of benefits, and the idea is that it's a completely different technology with different methods... it's not things are missing, it's that they are just done differently.

Problem is Microsoft doesn't make it obvious the "new" way to do it. And yes there are also a few things done poorly (some of which you brought up).

The biggest problem though... now selling the idea to the boss. I couldn't, it just wasn't going to happen. Just to find the benefits myself (and I had used WPF BEFORE coming to work here) took me time... time with out you just aren't going to see the benefits. I couldn't find any way to sell the idea to the boss enough to make it seem worth it on a risk/financial level.


Here's to hoping WPF matures a bit more and the benefits become more obvious.
Was This Post Helpful? 0
  • +
  • -

#14 Frinavale  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 203
  • View blog
  • Posts: 776
  • Joined: 03-June 10

Re: Is WPF really *this* lacking, or am I just an idiot?

Posted 17 January 2012 - 03:09 PM

If you already have experience with WPF then your learning curve is probably a lot smaller than most people. The way I sold it was creating 2 projects (one Win Forms and one WPF). I created a simple address book type application and demonstrated the freedom of WPF vs the constricting controls of Win Forms...it helps when your boss has technical background. While there was a learning curve (it's a little overwhelming when you first start using it), we don't regret choosing WPF.
Was This Post Helpful? 0
  • +
  • -

#15 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5678
  • View blog
  • Posts: 12,213
  • Joined: 02-June 10

Re: Is WPF really *this* lacking, or am I just an idiot?

Posted 17 January 2012 - 03:37 PM

Here's the thing... I don't really have to sell it. I have to do what I'm told and somehow cover my ass when production speed drops. The boss read about three paragraphs on it and said "This is how we are doing things from now on." Mind you he doesn't program for Windows, and I'm tutoring him in C# via email. The last language he was proficient in was assembly in the 1970's. It's been over 6 months, 2 of which I lived at his compound in an intensive C# bootcamp and he still has trouble grasping the tutorials I wrote here for rookies. :v:

He decided to go this direction because he read WPF leverages the power of DirectX and offloading the work of processing graphic onto the graphic card/GPU. That was enough for him, he didn't have to investigate any further.

So now I have to support it... When production doesn't magically become faster, amazing and programs magically work faster etc. etc., I have to explain delicately that it was a decision that would never yeild the results he expected. And as we all know, I'm the king of 'delicate'. :tank:

Mind you, it is a technology that I continue to say has a lot going for it. And it is a technology that I recognize I need to add to my resume arsenal just in case. So I just have to bite the bullet and see this fiasco as paid training in a new technology.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2