The Lounge is rated PG. If you're about to post something you wouldn't want your
kid sister to read then don't post it. No flame wars, no abusive conduct, no programming
questions and please don't post ads.
1. The lounge is for the CodeProject community to discuss things of interest to the community, and as a place for the whole community to participate. It is, first and foremost, a respectful meeting and discussion area for those wishing to discuss the life of a Software developer.
The #1 rule is: Be respectful of others, of the site, and of the community as a whole.
2. Technical discussions are welcome, but if you need specific programming question answered please use Quick Answers[^], or to discussion your programming problem in depth use the programming forums[^]. We encourage technical discussion, but this is a general discussion forum, not a programming Q&A forum. Posts will be moved or deleted if they fit better elsewhere.
4. No politics (including enviro-politics[^]), no sex, no religion. This is a community for software development. There are plenty of other sites that are far more appropriate for these discussions. Or if you must, use the Back Room[^] - but enter at your own risk.
5. Nothing Not Safe For Work, nothing you would not want your wife/husband, your girlfriend/boyfriend, your mother or your kid sister seeing on your screen. For those discussions where you wish to be a little more frank, use the Soapbox[^]
6. Any personal attacks, any spam, any advertising, any trolling, or any abuse of the rules will result in your account being removed.
7. Not everyone's first language is English. Be understanding.
Please respect the community and respect each other. We are of many cultures so remember that. Don't assume others understand you are joking, don't belittle anyone for taking offense or being thin skinned.
We are a community for software developers. Leave the egos at the door.
Some horrid, scurrilous, misguided people have had the nerve to suggest that the cyber-criminal's currency of choice might be a new take on the good old Ponzi scheme (the one where a con-man gives Investor #2 some of Investor #1's money as a convincer and keeps going down the blockchain line doing that until the scheme is established as a sure-fire winner).
They couldn't possibly be right, could they? Nah! It's all about as kosher as it gets. <Wondering-what-that-very-loud-popping-noise-in-the background-is-emoji>
Recently, I had an interesting discussion with another CPer who took umbrage with my recent article which summarized a shift from WinForms directly to UWA/UWP XAML and ignored WPF XAML.
I mentioned that WPF was indeed ignored by vast numbers of devs and that no shop I've worked in ever paid it more than scant attention. I also mentioned that many devs seemed to (perhaps improperly) connect WPF with Silverlight and MS killed Silverlight in the quiet of the night and many devs never felt much motivation to go to WPF.
Not Reviving A Debate Or Anything Against WPF-minded CPer
Of course, WPF is used all around, I'm sure. This post is not an attempt to revive a debate that ended up being a very good discussion. I think the CPer was definitely correct on many things he said.
My point is the following (and I think it is interesting):
Trying To Find XAML Control Solutions: Difficult
Today, I was looking for a way to make sure my UWA (XAML-based) app's ListView would show the last selected item even when it lost focus -- keep it highlighted.
Could Only Find WinForms Answers
As I searched I could find nothing but WinForms answers about how to do that. Those answers are like 7 years old.
Should Be Very Simple and Is In WinForms
The answer should be very simple. WinForms Answer : In WinForms the answer is set the HideSelected property to false.
This is something that is an obvious functionality in a ListView. So obvious that WinForms provided a property.
Not so in XAML. Hmmm...
Yes, I am a newbie to XAML and someone will surely post the answer to how to do this in XAML as soon as I post.
Feels Like Microsoft Never Fully Developed XAML Either
This kind of thing makes me feel like Microsoft never carried out the XAML development all the way either.
Just thought it was very interesting. How about you?
I also own this book Universal Windows Apps with XAML and C# Unleashed [^] -- probably the best one available on UWP XAML and it does not have these kinds of details either.
However, this type of thing was always covered quite well on the WinForms side and even if you couldn't find it, you could look through every property.
There is very little benefit, really.
And I think many people feel this way.
The benefits that do exist are indirect.
They are things like: 1. Only UWP apps will be admitted to the Windows Store. 2. Getting into the Windows Store makes it a bit easier (for indie devs) to deploy their apps to the population of Win10 users. 3. Uh...Microsoft is telling us that Win10 is the future and that UWP is _The Way_ to develop apps for that future (Win10). 4. I'm now attempting to make up more benefits...think...think... Oh, yeah, WinForm technology is old and crufty and it is really bad for MVC (the pattern, not the microsoft thing) since so many of the Concerns are tied together in WinForms. So XAML does better binding and UWP is XAML based.
Totally agree 100% with everything you said.
And maybe this is really means the end of an era with Microsoft.
Just not sure how they survive all of this because it seems like a lot of devs feel this way.
Or, does it mean they continue to limp along on 20 year old technology and devs are fine with that because that is what they know anyways?
1. It's something that's of interest to enterprises because they can offload many of their apps to use this technology without rewriting; it makes distribution easier for them if they run their own enterprise version of the Microsoft AppStore (this is something I know that businesses are keen on).
2. It opens up the opportunity for Microsoft to vastly increase the amount of applications it can deliver from the app store (as well as increasing the target devices if they ever do manage to get a mobile version out the door).
3. As Microsoft charge a fee for serving apps from the app store, this increase gives them an opportunity to tap into a very lucrative market here.
WPF and UWP are, one way or another, getting closer together with the formulation of XAML Standard.
In a year or so, this will generalize XAML to the point that UWP, WPF, Xamarin.Forms (and Unity3D assets like NoesisGUI) will all work with the same basic XAML.
Add that to the steady evolution of WebAssembly, and you'll end up with local HTML clients running C# and XAML somewhere around Q4/2018-Q1/2019.. if nothing goes horribly wrong.
My money is on UWP and WPF devs eventually migrating to HTML5/electron running C# with some iteration of XAML Standard. At that point, the boundaries between web and desktop apps will be gone, and everything else can be deprecated.
it is really bad for MVC (the pattern, not the microsoft thing)
Really? Simply use the forms or controls as views and write yourself some nice baseclasses for the controllers (or presenters in my case). To completely get rid of the forms concept, you may also need some concept of a workspace. Easy as pie and I have ported code from ASP .Net web forms (a hack, I must admit) to WinForms, from there to WPF and from there to my own UI in XNA (now MonoGame).
I have lived with several Zen masters - all of them were cats.
The "U" in UWP to me says it all: Universal. One codebase that runs on desktops, mobile (or at least used to ), tablets, Xbox, SurfaceHub, HoloLens, and IoT devices. That may not be attractive to all developers or for all use cases, but from my admittedly narrow understanding it opens up some pretty slick possibilities without the effort it takes to get other approaches working on multiple platforms.
Full disclosure: I'm not a developer but I am a Microsoft employee. Flame on.
WinForms, or better, the Common Controls, are very underappreciated; it is a mature product. A standard that is not just available on Windows anymore, as WinForms work just as happily under Linux.
I'm sure that WPF is better for graphics, as advertised.
I build tools for people that work. They don't care about flashy, they care about reliability and predictability. I'm not paid for animated borders, but functionality - and will probably still be maintaining WinForms code by the time that our great overloads predicted that AI will write code.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
As someone who has spent far too much time wrestling with the quirks of the MS supplied WinForm Controls ... many of which are .NET wrappers around old COM.ActiveX Controls ... I have a less "rosy" view of them: imho, they are a herd of cats
From the "cup is half-full" perspective, you could say that MS enabled a market for 3rd. party control developers to create much more powerful and internally consistent controls, with consistent API's. I remember, so well, my elation when I discovered Andrej Stojkov's Lidor TreeView Control: felt like I had gotten out of jail
I was excited, initially, by WPF's promise of an all-vector rendering engine, bubbling event-model, superior binding facility, etc. And, of course, symbiosis with a web-stack, SilverLight.
There was some great work done here, on CP, by pioneers like Clifton, Adrian Alexander, O'Hanlon, Josh Smith, Sacha Barber, and others.
The reality of programming in Visual Studio with WPF, however, just was not right ... for me.
Then, came the debacle of Metro, the deprecation of SilverLight, the failure of Metro, MS VP Sinofsky's (Metro honcho) departure, the WinRT hoop-la, etc. A lot of devs felt burned; fence-sitters, like me, decided to stick with WinForms.
If only ... one can waste time fantasizing about ... WinForms had a retained-mode all-vector, 2d graphic engine, and WPF's event and binding facilities. A Designer.cs file-format that at least was more XML-like, or, even XAML like.
A few comments:
1. For WinForms TreeView and ListView that would be the 'HideSelection Property.
2. There is a more recent (2016) 2nd. ed. version of Nathan's book for Windows 10: [^], but it's listed as unavailable on Amazon, currently.
«While I complain of being able to see only a shadow of the past, I may be insensitive to reality as it is now, since I'm not at a stage of development where I'm capable of seeing it.» Claude Levi-Strauss (Tristes Tropiques, 1955)
Really like your summary of the situation because that is my experience too.
I've been using those old controls since Win3.1 -- okay Win95 --- okay I guess they get updated once in a while but it seems like those are the same controls we've been working with since Win95 and you're right there is plenty about them that is bad / crufty / cracked.
But, since we've been working with them for 20 years we know how to get around those things.
I remember about the time Vista released I started messing around with WPF / XAML and wasn't that impressed seemed like a bunch of stuff to learn to draw my own controls when I could more easily drop a windows treeview on a WinForm app and be done. I'm no graphic artist so I let the TreeView be a TreeView.
Then the Silverlight debacle and all the rest just as you said.
Now Microsoft does the head-fake to UWP. I start learning XAML again and it is pretty cool.
But then you go to look for these things that must surely be easy even in XAML since people have been doing WPF / XAML, right? But you can't find the answers? It's all just crazy.
Also, it is very interesting that the author changed that book's name to Building Windows 10 Apps from the previous name of Universal Windows Apps.
Makes me feel like Microsoft whispered in his ear something like,
"Uh, we're backing off the whole UWP/UWA thing, so..." ugh!
WinForms are really easy. And I mean, REALLY easy, I've enjoyed using them for years.
The click for me, when going to WPF, is: 4K monitors. If your resolution is high-res (such as, for 4K), WinForms are taking a really big fall. About close to 2 years ago, I got a laptop with 4K resolution. At this point, things starting to go downfall. What you see in the VS designer, is not what you will see visually. Some of the controls you create will look incredibly messy. The AutoScaleMode : if you go with Font, it will look horrible. If you go with Dpi, sometimes it's decent, sometimes not - what I've found is that most of the time, as long as I keep the form/control under 1900x1080, it's ok; and as a side-note, never go with None.
Now, add to that the Anchor property - which I used heavily to properly align controls. It seldom works on high resolution monitors.
What you end up is pretty much "try to see if it works". And "if" it works, you need to then test at other resolutions. So, long story short, as monitors get higher and higher res, WinForms is losing ground.
Now, onto WPF - really steep learning curve, but the results can be amazing. A lot of things will once again be "trial and error" at first, but once you get the hang of it, and if you have some pretty fancy UI in mind, WPF can definitely help you there. That, and Resharper
As I get older all my skill declines..
For example after reading your message a few times I fail to see your point.. is it a question? (about what?) a statement? (for whom?)...
Glad you play with XAML anyway. XAML is great!
Other than that WPF is great! Ever heard of Visual Studio? It's a WPF application ya know!
But not many people write desktop application these days, that's why WPF is kind of neglected...
I have used WPF outside on my personal projects and as has been said before WPF makes the simple complicated and the complicated simple.
My experience is that it's a bit like doing web development - it can be a real PITA but when done right gives you something nice to look at... and that's pretty much what it comes down to - you can create 'nice' custom controls and it encourages loose coupling of the data and the UI.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
Last Visit: 31-Dec-99 19:00 Last Update: 14-Dec-17 3:54