New WPF Features: Jumplists

This is part of a series on New WPF Features

Jumplists is a feature of Win7 where in you can the context menu is richer than the usual close\restore options. WPF provides a managed API to work with these features in Win7.

Now that we have seen how it looks like, lets look at how its created [Thanks to Andre for the initial code :) ]

Setting up the jumplist is simple and API is really easy for addition\deletion of items

            JumpList jumpList = new JumpList();

            JumpList.SetJumpList(Application.Current, jumpList);

            JumpTask jumpTask = new JumpTask();

            jumpTask.Title = jumpTask.Description = namesToUse[0];

            jumpTask.CustomCategory = "DocumentApps";

            jumpTask.ApplicationPath = "notepad.exe";

            jumpList.JumpItems.Add(jumpTask);

            jumpList.Apply();

Now for setting up those buttons at the bottom of the Preview image

<Window.TaskbarItemInfo>

       <TaskbarItemInfo

   Description="My TaskbarItemInfo"

   Overlay="..\Resources\powerButton.ico">

            <TaskbarItemInfo.ThumbButtonInfos>

                <ThumbButtonInfo

                   Command="Cut"

                   CommandTarget="{Binding ElementName=textBox}"

                   Description="{Binding RelativeSource={RelativeSource Self}, Path=Command.Text}"

                   DismissWhenClicked="False"

                   ImageSource="..\Resources\cut.png" />

 

Clicking on the buttons Dismiss the previewpane by default. Overlay allows you to place another image as seen in the taskbar (powerbutton icon overlays the shield)

The code for the sample is attached

 

Share this post

 

Jumplists.zip