In the Windows 7 taskbar development series previously written, we developed the application's taskbar with Visual Studio 2008 with Microsoft's Windows API Code Pack, and the upcoming Visual Studio 2010 provides us A more convenient way to develop, the new version of WPF 4 requires only XAML code to implement the features of the Windows 7 taskbar. This article will introduce the jumplist (Jump List) and experience the new features of the. NET Framework 4.0.
Writing JumpList in XAML
The handy thing about developing the taskbar in WPF 4 is that you can use XAML to write the appropriate functional code directly without using the API to write cumbersome C # programs. First open the App.xaml file to join the JumpList program we want, where the JumpList class provides a way to create a Jump List, Jumptask class can create a link in the list. By comparing the jumplist written by the API, it is obvious that the XAML approach is much simpler and clearer.
<application x:class= "Win7taskbardemo.app"
xmlns= http://schemas.microsoft.com/winfx/2006/xaml/ Presentation "
xmlns:x=" Http://schemas.microsoft.com/winfx/2006/xaml "
startupuri=" MainWindow.xaml "& Gt
<application.resources>
</application.resources>
<jumplist.jumplist>
<jumplist showfrequentcategory= "true"
Showrecentcategory= "true"
<jumptask Applicationp Ath= "notepad.exe"
customcategory= "Microsoft Tools"
description= "Start notepad"
Title= "Notepad"
iconresourcepath= "notepad.exe"
iconresourceindex= "0"/>
<jumptask applicationpath= "MSPaint.exe"
customcategory= "Microsoft Tools"
Descript ion= "Start Paint"
title= "Paint"
iconresourcepath= "MSPaint.exe"
Iconresourc eindex= "0"/>
<jumptask applicationpath= "http://gnielee.cnblogs.com/"
customcategory= "Blog Link"
Description= "Go" {Gnietech} "
title=" Gnie ' s Blog
iconresourcepath= "C:\\Program File S\\internet Explorer\\iexplore.exe "/>
</jumplist>
</jumplist.jumplist>
</Applicati On>