(Overlay Icon, Thumbnail Toolbar, Progress Bar)
In the previous article, we described how to develop a Windows 7 Jump List in WPF 4, which will continue with other features of the taskbar in WPF 4: Overlay icon (Overlay icon), progress bar (Progress bar), thumbnail toolbar (Thumbnail Toolbar) for research. API development for these features can refer to the Windows 7 taskbar development Series Rollup.
Taskbariteminfo
In the System.Windows.Shell namespace, the Taskbariteminfo class contains all of the above Windows 7 taskbar development features, through which we can customize the various features of the software taskbar, whose class members can refer to: Taskbariteminfo Members.
Thumbbuttoninfo
Also in the System.Windows.Shell namespace, the Thumbbuttoninfo class provides us with the ability to develop a thumbnail toolbar that can be referenced by members of the class: Thumbbuttoninfo, as described in the following sections.
Overlay icons (Overlay icon)
When developing overlay Icon via API, it is necessary to simply call the Setoverlayicon method. Developing in WPF 4 is still very simple, and it can be implemented simply by assigning an icon value to the overlay attribute of the Taskbariteminfo class in XAML, as shown in the following code:
<Window.TaskbarItemInfo>
<TaskbarItemInfo x:Name="taskBar"
Overlay="Resources/Question.ico"
Description="Taskbar Items Sample">
</TaskbarItemInfo>
</Window.TaskbarItemInfo>
This adds a "question mark icon" to the program icon:
Thumbnail toolbar (Thumbnail Toolbar)
Below we add a thumbnail toolbar to the program, add a Shield button to it (Safe.ico), and then replace the "question mark icon" on the image above. First, add the Thumbbuttoninfo content to the toolbar to load the keys on the basis of the preceding code:
<Window.TaskbarItemInfo>
<TaskbarItemInfo x:Name="taskBar"
Overlay="Resources/Question.ico"
Description="Taskbar Items Sample">
<TaskbarItemInfo.ThumbButtonInfos>
<ThumbButtonInfo x:Name="changeIcon"
DismissWhenClicked="True"
Click="changeIcon_Click"
Description="Change overlay icon"
ImageSource="Resources/Safe.ico"/>
</TaskbarItemInfo.ThumbButtonInfos>
</TaskbarItemInfo>
</Window.TaskbarItemInfo>