Learning WPF: Share your experiences

15 Dec
by mjeaton, posted in Uncategorized   |  10 Comments

I have spent the past few years working almost exclusively in WPF with a little bit of Silverlight thrown in for good measure. While I have worked on some web projects over the years (mostly 99-08), I spent much of the 90s working on VB applications (versions 2 – 6), so I’ve always considered myself a client / desktop developer.

WPF was a natural step for me, but I do remember having to get over the learning curve. I definitely recall a few “aha!” moments, but never found it all that difficult. When I was in Redmond earlier this year for the MVP Summit, I recall talking to some folks from Microsoft that told me how tough they thought WPF was. This surprised me because I never thought it was *that* tough, and honestly, the people saying it to me are freakin’ SMART, so how could something that came relatively easy to me be tough for them?

So, as I prepare for an upcoming talk, I’m interested in your experiences learning (or trying to learn) WPF. If you have learned, tried to learn, or are currently learning WPF, please take a few minutes to share your experiences in the comments section.

Specifically, what I’m looking for are answers to these questions:

What was your initial impression?
Was it easy? Was it difficult?
What did you find most difficult to learn?
Did you give up? If so, why?
What was your prior experience? What technologies? Was it with desktop applications or exclusively web?
What resources did you use to get past the issues / problems you ran into?
What advice would you give to someone learning WPF? (Question added on 12/17/2010 @ 10:10am)

As added incentive, on December 29, 2010 at noon (eastern time) , I’ll randomly select someone that shared their experiences. That person will get a cool prize from DevExpress!  If for some reason that person doesn’t want the prize, I’ll select someone else. I’ll announce the selection both on this blog and on twitter.

Technorati Tags: ,,

10 Responses to Learning WPF: Share your experiences

  1. Wendy Czymoch

    I’m working on my first production level project in WPF right now so I’m just starting the learning curve. Been working at it for about 2 months.

    My initial impression was that it was going to be one incredibly powerful tool. It has not let me down.

    Some things are easier such as layout, other things have presented some challenges such as setting the values of text fields, once I trained myself to use Contains things got easier. That’s just part of a new framework, though why they would change that syntax I don’t know.

    Everything has been a challenge in one way or another, but nothing has been impossible. I think the major learning curve is MVVM. For me, learning a new framework coupled with a new design pattern made things far more challenging than they needed to be. For now I’ve abandoned MVVM and am concentrating on WPF. I’ll revisit MVVM in a couple of months.

    I’ve done some limited web development. I’ve been a C# developer for 3 years and was a VB dev for two years prior to that. Most of my applications are desktop or web services.

    Google remains my biggest asset for getting past issues, the MSDN sources don’t seem quite up to par yet. I also used the WPF toolkit from CodePlex to solve some of my issues. As far as books I’ve used O’Reilly’s Programming WPF and Illustrated WPF from Apress

  2. Ronnie Swafford

    My initial impression was, wow…I can really do that? I’ve always wanted to do that!

    I found WPF easy after a couple of hours of wrapping my head around it.

    For me, the most difficult thing to get through my head was the ease of data binding.

    I’ve never given up on WPF but I’ve been pulled away to work on everything from BizTalk to SharePoint,limiting my time on the platform.

    I started in the late 90′s with strict HTML and javascript after learning to program in BASIC in the 80′s. In the early 2000′s I was working on asp.net web applications and SQL Server.

    Luckily for me, the community around WPF and the great speakers at my local .Net group got me on track quickly and have kept me there in spite of my best efforts to de-rail.

  3. Nathan

    My prior experience was mostly with Windows Forms development. Therefore, I was approaching WPF development with that paradigm in mind, which took a while to unlearn.

    For me, it took a couple months of working with WPF full-time for me to look back and realize that I just “got it.” It wasn’t that the language was that difficult during the beginning period. It was just difficult to grok why WPF was better and how to best leverage it. Specifically, I noticed that after those first 2 months I began to understand Databinding and how to use Blend.

    TotalTraining.com had some videos that were very useful for learning Blend (although they may be out of date now). My biggest recommendation would be to work heads down in WPF for several weeks until it starts to make sense. Just learning it in spare time efforts will be difficult.

  4. Ryan Cromwell

    This turned into a bit of a brain dump…

    I found learning WPF relatively natural, but the key for me was the testability. Once I realized how close to the chrome I could get with my codebase, learning WPF and leveraging data binding was essential.

    I was also lucky in that I had a chance prior to release to spend a week with the WPF (and then WPF/e) team. This helped me understand where I should focus my learning (Databinding, Blendability, Templating).

    I personally feel that people learning WPF make things very hard on themselves by getting caught up in the Xaml. If you work really hard to understand the information you are trying to present rather than the actions you are trying to take on behalf of the user, your Visuals become a simple representation of your information model. This part is really hard to unlearn (reactionary programming).

    I also often find that the things that people have trouble with are developing interfaces that are unnatural for the user (looking at you datagrid).

    The best reference I read was Charles Petzolds Applications = Code + Markup. It’s a brutal read, because it’s long, dense, and dry, but it’s the best. Adam Nathan’s book is good reference, but not as fruitful in the long term. At least read the first half of Charles’ book: Code.

    Xaml certainly is verbose. Element notation can be jarring at first, but I feel the more languages you know, the more readily you can accept this new Property setter mechanism. In the end, you’re just newing up an object tree and setting properties. It’s a pretty dumb language. In fact, element notation may make it more clear for the beginner since properties won’t as easily get confused with new object declarations.

    In the end, I love WPF, get annoyed at the limitations of SL and WP7, but still prefer the model over Html+JS (Knockout is sweet though!) and definite Winforms, Java Swing, etc.

  5. Nick Portelli

    My initial impression was “Holy crap this is fricken sweet”, it quickly turned into “Holy crap this is fricken frustrating, but sweet and way better than winforms”

    My pain points were learning WPF AND MVVM at the same time. I already knew the evils of code behind and didn’t want to go there. Plus when I championed using WPF for work, the MVVM pattern was pretty new and not too many frameworks were out yet, or I didn’t know about them.

    Was WPF hard to learn? No. Was it easy? No. It was different. I dove into the XAML and never bothered with the designer. The things you can do with xaml and data templates still amaze me. Yet when you get to data grids or calendar controls it frustrates me. The most difficult thing to learn(unlearn) was how to do everything with little to no code behind. The databinding model was not entirely new, something similar existed in Winforms but it was not used often.

    I did not give up, what are your other options? Winforms? Might as well shoot yourself now if you go winforms. I kept digging and found MVVM Light. A great framework that helped address a lot of the issues and questions I had. The Messaging class is awesome. I’ve not dug into many of the other options for MVVM out there, but there are a lot of good options.

    As of late I’ve been doing client/server programming. I can see how people would think WPF was hard coming from webfroms. The mindset is very different. But I’m very confused on why people complain about XAML, especially from the perspective of HTML, CSS and JavaScript.

    Google and twitter are the biggest resources for me in learning anything new.

  6. Jay R. Wren

    I’d need hours to list all of the challenges I faced. Here is the 30min version (yes, I thought about it for that long).

    My initial impression: That data binding looks awesome. Finally no more winforms binding b.s.

    It was not easy. The difficulty was in coupling it with good coding principles. XAML not made to mix with don’t repeat yourself principles. The INotifyPropertyChanged implementation for databinding was also hugely challenging. Much documentation says that /PropertyNAme/Changed event should also do the job, but I could never get this work. Again there was much DRY violation around the ceremony to write INPC properties (until I found notifypropertyweaver).

    The most difficult thing to learn was… when to use what features. Between MVVM, property and data triggers –which I have now learned are in one group, separate from– event triggers, Converters, and templates, i had (and still often don’t) no idea which tool is right to implement a given feature in my application.

    I don’t give up. I did put it on the back burner for many months.

    My prior experience was web circa 1995-2002, GTK+ and Winforms.

    The best resources were(and continue to be) coworkers and stack overflow.

    A huge gripe of mine is that all of the book that I have read (Unleashed, Code+Markup, Programming[o'reilly], and Essential) cover the basic features but none show how to apply them, so you are really left with more questions than answers.

    When do I use a Converter instead of binding to a dependent property in my view model? When do I bind to view model properties instead of simply using a style and property or data trigger?

    Another “problem” with the learning process is that its very easy to read the WPF books and skip or quickly skim the chapter (or chapters in all 4 books I read) on animation. This is a huge mistake. I blame the book authors for calling it animation. Its not. Those chapters should be called Application State Management. In every case I’ve found the event trigger topics are buried in the animation chapters and it is by far the most important topic for keeping a nice UI (please wait spinners, etc) and really has little to do with animation. Event Triggers can imply an entire state machine letting me write far less code, but none of the texts I’ve read spell this out. They do spell out “oh yeah, if you want animations do this.” This is a disservice to readers.

  7. Nick Portelli

    I should mention dependency properties. I still don’t understand them. How and when to use them. Same for ddorners. Both play a large part in visual data validation and what not.

  8. Tim Schilling

    I always struggle working with the databinding and templating. Specifically when you need to work up or down the element tree based of the instance of the data bind. May be a good general topic for ya. :)

  9. Nma-Sie-Anyene Davenport

    What was your initial impression?
    Since I love creating GUI’s, my initial impression of working with WPFs was probably that of excitement. Basically, here’s yet another form of creating an application and making an inefficient business process turn into something that can be handled with a few clicks.
    Was it easy? Was it difficult?
    I think application development is going to always fall into that middle category of “challenging” for me. Working with WPF isn’t difficult, per se, because there are so many resources online for this. However, I wouldn’t say “easy” because that would imply that I had no need to refer to my any outside sources for problem-solving, which isn’t true. I’d say it was as challenging as it was enjoyable.

    What did you find most difficult to learn?
    Data binding has always been intimidating to me. Ignoring that, I’d say nothing, really, but then again, I’m sure I haven’t touched the tip of iceberg as far as everything that WPF has to offer.

    Did you give up? If so, why?
    No, haven’t given up. Just haven’t worked on any projects within the last year using it.

    What was your prior experience?
    Creating organizational applications with a bit of workflow behind it.

    Was it with desktop applications or exclusively web?
    Web

    What resources did you use to get past the issues / problems you ran into?
    Books 24/7 has a plethora of knowledge (but then again, I’m a book person); and of course, Google. ;-)

  10. Michael Eaton

    And the winner from the random selection is….

    Ryan Cromwell :-)

    Thanks to everyone who took the time to give me some valuable feedback.