I haven’t really dived deep into the new bits with WPF 4 since installing VS2010 Beta 2, I decided to blog about the new Windows 7 taskbar-integration features that comes supported with WPF 4.
Although Microsoft released a Windows 7 Code Pack, allowing you to leverage the great new taskbar features in Windows 7, as well as many of the new Windows 7 features. There wasn’t really an easy way to do this through XAML. I’m quite happy to see this now in WPF4, and how easy it is to enable these taskbar goodies for your WPF applications. I’m going to just start off with talking about two apparent features that I’m sure most developers would like to bring to their applications: Taskbar Progress and Taskbar Overlays.
Taskbar Progress
For the early and recent adopters, you may have noticed that the taskbar buttons are now more richer in terms of the feedback that’s shown to users. One of those is progress updates. This is particularly useful when you have a long running operation, like a copy/move operation, where you would usually minimize the window to (at least, that’s what I do), and you also want to quickly see how it’s doing.
This is what an explorer copy and paste operation looks like:

It’s really useful to see the progress of a long running operation without having to restore or bring it back into focus.
In order to enable your applications to report progress to the taskbar, you will be required to add this feature into your applications.
Fortunately, WPF 4 now introduces a generic taskbar item class(TaskbarItemInfo) that allows you to configure this. If you want to configure your application to have an indeterminate progress, you simply have to set the TaskbarItemInfo.ProgressState to Indeterminate.
<Window.TaskbarItemInfo>
<TaskbarItemInfo ProgressState="Indeterminate" />
</Window.TaskbarItemInfo>
And this is what it ends up looking like:

If your application can determine the remaining progress, you can choose to set the ProgressState to Normal, and then within your code, whether it be through the code behind, a command, or whatever it may be, you can then set the property ProgressValue on the TaskbarItemInfo. The ProgressValue property takes values between 0.0 to 1.0.
There is a few other enum values on the ProgressState which you can explore with TaskbarItemProgressState.
Taskbar Overlays
Another great feature that Windows 7 has introduced into the taskbar is the notion of overlays. In a nut shell, they are simple icons that are displayed on top of the taskar icon. It’s also extremely trivial to enable for your application. Following from the same code sample from above, we simply set another property on the TaskbarItemInfo:
<Window.TaskbarItemInfo>
<TaskbarItemInfo Overlay="Green.ico" />
</Window.TaskbarItemInfo>
And the result is:

There is so much more to cover with the new Windows 7 taskbar integration features that WPF 4 brings to us. I’ll blog more about it soon.