Dev Week, day two

This time I decided I’d spend as much time examining WPF as possible. I didn’t spend all day on WPF, as not all the presentations appealed to me.

The first presentation of the day on Asynchronous programming for WPF proved to be very interesting. Microsoft is heavily stressing the use of threads other than the UI thread for functional processing. The Silverlight presentations the day before were also at pains to stress this.

I guess Microsoft is trying to push developers to make their fancy new UI architecture look as good as possible. The advantage of using separate worker threads is that your UI remains responsive to the user, while your application spins away in the background.

Unfortunately, there is one major problem associated with this pattern. Thread affinity for almost all Windows UI elements is still a requirement. What this means is, should you try to update a control with results from a non UI thread, your application will throw an exception. This is not a new phenomenon, but some cleaner solutions were outlined.

Typical approaches for resolving this issue were mentioned, including a reference to the new, rather clean, method of using a SynchronizationContext instead of using the typical Dispatcher based approach. I recommend anyone writing UI based applications, whether WPF or Silverlight, to consider using at the SynchronizationContext class it’s much less messy than using a Dispatcher.
Also discussed was the rather easy to use, if somewhat high level, Background Worker Thread control. Not new and a bit happy-clappy, but still undoubtedly useful.

The next presentation I attended was on Developing WPF custom controls. An interesting prospect when you realise XAML has managed to separate the styling and templates from the UI code, a long time coming. Microsoft refers to this as “Lookless” controls, a complete separation of Code from the View elements of the UI. Of course separating style from behaviour is hardly news.

The presenter of both presentations, Dave Wheeler, sort of a techie Jeremy Clarkson, went on to recommend developing new controls as “composed” controls, and not designed from scratch. Some mention was also made of a modified MVC pattern, using a ModelView hybrid class for abstraction. This is probably very useful when integrating applications.

The next presentation was changed from Smart Client Content (as apparently there isn’t one anymore) to WPF Interoperability. These were real world experiences of development migrating from Windows Forms based applications to WPF applications. Some changes relating the use of Windows Handles in WPF was discussed as well as unmanaged code considerations. With WPF only using a single master Windows Handle the issues relating to Modal windows were raised. A rather neat (if a little impractical) integration of WPF with the Glass API was demo’d. Pretty. Apparently WPF doesn’t support the Glass API out of the box.

The last presentation of the afternoon was different, concentrating on using OLAP via the MS Analysis Services. To be fair, most of this presentation went right over my head. You could write what I know about OLAP on a postage stamp. The presenter, Javier Loria, seemed very knowledgeable and really gave me the impression using a specialist in this sphere was the only sensible approach.

, , , ,

  1. Leave a comment

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: