In my previous posts I’ve demonstrated how to customize the Windows 7 Taskbar Jumplist with custom icons and actions. In this post I would like to show how to leverage XAML Markup Extensions to pick the right assembly name for both the application full path and icon resource full path.
One real bizarre thing in the WPF Jumplist is that there is no option to initialize some Jumplist properties after created from XAML. For example: The JumplistTask application path. The only option is to create the whole Jumplist from code behind (Horrible…).
So I had an idea to use XAML markup extensions to do this job and stay in XAML.
<JumpTask Title="Say Hello!"
Description="Display Greeting Message"
And the markup-extension looks like this:
/// Provides executing assembly full path.
public class ApplicationFullPath : MarkupExtension
public override object ProvideValue(IServiceProvider serviceProvider)
Of course you can create something more sophisticated with arguments and more logic, but this little one does the job and your code stays clean.
Feel free to download the code from here.