Beginners Guide To WPF, WPF

A Beginners Guide To WPF

I have been working with WPF a little while now and have published a fair number of WPF articles over at codeproject but in one of them I was slammed for writing a intermediate article that had been mistakenly classified as a beginners article.

At first I was a bit annoyed at this, but then I started to hunt about, and there really aren’t that many beginners articles for WPF, so I decided to write a beginners WPF series. This series will be structured as follows:

Part 1 : Layout

Part 2 : XAML vs Code / Markup Extensions

Part 3 : RoutedEvents And RoutedCommands

Part 4 : Dependancy Properties

Part 5 : Databinding

Part 6 : Styles/Templates

End of series Exemplar

I hope they are useful to someone. Have a look for yourself


31 thoughts on “A Beginners Guide To WPF

  1. Thanks Karl

    Dont think I’ll be teaching you much though bud..its very basic stuff, for beginners, not advanced WPF masters such as you.

    But thanks anyway

  2. Sacha,

    you’re one of these guys that make codeproject the best developer portal i’ve ever seen.

    every search for a developing question takes me to codeproject.

    and every search for wpf takes me to your articles!


    I hope you have a lot of time to write more articles on wpf!


  3. Martin

    I thank you very much for these kind words. For me I just love to share stuff, and write articles you learn so much doing this.

    For me Josh Smith / Karl Shifflett are my codeproject heros. And Daniel Vaughan / Marlon Grech are excellent as well.

    Also you will be interested to know that my next WPF article in this series will be available today (Sunday 20/01/07) and the 3rd part maybe by next weekend.

  4. Sacha
    I know I should think of the environment and all that stuff but I did notice that the print versions of your cool ‘Beginners Guide To WPF’ articles are chopping off text (only article 4,5 and 6) I have tried this in Firefox and IE.

  5. Sorry to say it looks A-ok this end, in FF IE and Opera, Maxthon…they all look fine.


    I really try and get the formatting ok…I really do…Sorry..but if it just looks fine here.

  6. Hello Sacha,
    I have been following your articles more and more and your thoughts on WPF. I really like what you did with Marsa X, showing that one can really make some very interesting UI if one tries hard enough. While i haven’t been really interested in WPF prior to reading your articles, you got me really interested so much so that i went to my boss and proposed that the next big project of a window app have a WPF interface. I was really excited when he said ok, that sounds cool. I do not want this project to be delayed on account of the interface, so i should start learning WPF ASAP. I know that somewhere on your website or on codeproject you mentioned some great books on WPF and some tools (like Blend and such). Can you please post them again? Also, this project will have an n-tier architecture. My question is: Can i use WPF only for the presentation layer and have the Data Access Layer and Business Logic too?Thank you and i hope my questions where not stupid enough so as not to be answered(keeping fingers crossed on this one:D)

  7. Im glad you liked MarsaX, I thought it was cool too.

    As far as N-Tier goes, these days what we are doing at work is using N-Tier as follows

    WPF (Presentation layer) using the MVVM pattern.
    WCF for the service layer to retrieve stuff from a business layer Dll, which hooks into SQL server.

    So yeah its all possible.

    Hope you have fun learning WPF, its a big beast but its very rewarding.

    I like my Tabber3D article also, have a look at that one.

    A far as books/tools go:

    The best book by far is : Pro WPF, Apress, Mathew McDonald
    The tools : VS2008, Expression Blend, and I like Fireworks/Photoshop.

  8. Hi Sacha,
    Thanks for the info. I took a look at your tabber3d and i was amazed. I also found other articles on codeproject written by you and the UI is so amazing.
    I would love it if you would be so kind as to mention some books on the MVVM pattern. I searched the net and found some links, but didn’t really understand the architecture. (I guess i should start learning a lot more about WPF and then worry about that, but things are moving a lot faster at work then i anticipated in using WPF in apps so i need as many books and references available).
    Thanks so much for your input and keep writing:)

  9. There are no books that cover MVVM as its still very new, the best thing available are blogs etc etc.

    But they are good enough to get the ideas.

    Good luck with the learning, I am trying to learn WF right now, thats fun also.

  10. Hi. I have a question about DataTemplate and DataBinding.
    The question is how to create DataTemplate dynamically from code and attach it to the ListBox(for example)?
    So I have ListBox defined in xaml:

    and I want to create DataTemplate with StackPanel and couple of TextBlocks. How can I do it from the code?

  11. So I have MyListBox defined in Xaml, and in code this:
    DataTemplate dt = new DataTemplate();
    // here I need to fill the dt with stackpanel and something
    MyListBox.ItemTemplate = dt;

  12. Hi Boss,
    Nice to see a complete site from you. This are the my first article from where i am start my journey to WPF ( From Code project WPF part 1 to 5 ). WOW… How Organized Article those are……..

    Thanks for your Efforts !!!

    Cheers !!!
    Ur student Abhijit 🙂

  13. You are the man, its very tough to and need great patience to write above detailed and clear articles.


    1. Just use the Microsoft Terminal Services Active X Com control is a C# project either Winforms or WPF. Easy

  14. Hi i am Muralekarthick, i am a MS student, i am developing a windows application for a small concern, they want a really functionally rich UI, so i thought of WPF would be a good idea, can you give me some idea for good user interface designs and examples, can i get horizontal tabbed view of windows in WPF, which control i have to use for it , can you help me please i am very new to WPF, am very much quite interested with ur articles, take as ur student.

  15. And also can you clear me one thing will WPF windows application work fine with IE6 xp systems which is been used in the client side please.

  16. Hi Sacha. I was told you wrote the book. Is it coorect?
    When it’s published? Thank you, Alexander

  17. Hey there! I know this is kinda off topic nevertheless I’d figured I’d ask.

    Would you be interested in trading links or maybe
    guest authoring a blog article or vice-versa?
    My website goes over a lot of the same subjects as yours and I think we could greatly
    benefit from each other. If you happen to be interested feel free to shoot
    me an email. I look forward to hearing from you! Superb blog by the way!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s