Developing the Windows 7 taskbar using WPF 4

Source: Internet
Author: User

(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>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.