Pragmatic WPF series: Overview

26 09 2008

In the previous post I said that, as the “XPlorerBar” project progressed, I will publish new posts to keep you informed of the main problems met and the technical solutions set up to resolve them. This gives me the opportunity to begin a series of articles on discovering WPF features using Visual Studio 2008. For now, the list of the topics I plan to cover is:

  • theming,
  • skinning,
  • resource organization,
  • “lookless” control,
  • building an animated decorator,
  • pixel snapping,
  • generating MSDN-style documentation,
  • XBAP support,
  • designer support.

This list is not exhaustive and I would like you to let me know what area you’d like to see me publish. I hope this series of articles will help developers to feel confident building a WPF application and to dig deeper into some areas of the framework.





It’s time to start

21 09 2008

If you’re unfamiliar with WPF, building your first application can be a daunting experience. There are so many new concepts to master, that even simple things can turn into a nightmare.

In my opinion, the first two things to do, to enter in the WPF world, is to list all the new concepts that you want to discover and find an application (or a custom control) covering these concepts.

As a newbie in WPF, I chose to make a custom control (with its demo application) covering a wide range of concepts such as layout, styles, templates, brushes, routed events, theming/skinning, animation and resource management. To do this, I chose to clone the left side pane of Windows XP explorer, known as “Explorer bar”.

To make the experience more exciting and realistic, I chose to make this custom control as a control (part of a professional toolkit) with many features combining ease of use and high customization. The screenshots below give an overview of the goal to achieve. 

Main requirements

  • duplicates Windows XP explorer bar functionalities,
  • the explorer bar displays multiple sections, each section with a header and an expander,
  • expanders use animations to fade in (out) and slide down (up) when expanding (collapsing),
  • some sections can be designated as primary sections for a different look and feel,
  • optionally the explorer bar allows only one expander to be expanded at a given time,
  • at least five built-in themes (classic, aero, luna blue, luna olive green and luna silver),
  • vertical scrollbar auto-added as needed.

As the project progressed, I will publish new posts to keep you informed of the main problems met and the technical solutions set up to resolve them. Once the project is completed, I will write and publish a summary article for the “CodeProject” site.

I hope that this approach will seduce you and that you will share your comments or suggestions to improve both the project and this blog.

The next post will discuss the mechanisms to create a “lookless” control and to give it the ability to replace its styles and templates dynamically.





Want to learn WPF ?

20 09 2008

What is WPF ?

WPF – an abbreviation for Windows Presentation Foundation – is a set of .NET assemblies, intended to provide an API for creating rich and sophisticated user interfaces (UI).

One of its primary objectives was to bring together the best features of both Web development and the Windows development. It combines the good things from Web development, such as style sheets and a markup language (XAML), with the good things of Rich Internet Applications, such as scalable vector graphics (SVG), animation and media support. Moreover, these good things are associated with the good things from classical Windows development, such as data binding.

What is XAML ?

XAML (pronounced zamel) – an abbreviation for Extensible Application Markup Language – is an XML-based markup language, similar to HTML, used for constructing and initializing .NET objects. In practice, XAML is used with WPF to represent rich visual applications or other hierarchies of object, making easier the separation of front-end appearance and back-end logic (helpful for maintenance…).

WPF main features :

  • declarative programming,
  • a Web-like layout model,
  • a rich drawing model (2D and 3D),
  • animations,
  • audio, video and documents support,
  • styles and templates,
  • routed events,
  • commands,
  • data binding,

How to start using WPF ?

The first thing to assimilate is theory. It is very important to understand the basis of the language before beginning your first application. In this purpose, I recommend you the following books :

  • Windows Presentation Foundation Unleashed by Adam Nathan (SAMS),
  • Programming WPF by Chris Sells and Ian Griffiths (O’Reilly),
  • Pro WPF in C# 2008 by Matthew Mac Donald (Apress).

Another good source of information is blogs. The following blogs are, in my opinion, the most instructive :

Finally, all these readings will not prevent hours of reading of the MSDN (http://msdn.microsoft.com/en-us/default.aspx) to deepen your knowledge.

Good luck and see you soon.