Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version
Go to top

WPF: Integrating Our Application with the Windows 7 Taskbar (II)

, 3 Aug 2010
Let your user interact with your application using the new features of the Windows 7 Taskbar
WPFJumplistThumbnails.zip
WPF JumpList And Thumbnail Toolbars
WPF JumpList And Thumbnail Toolbars
bin
Debug
WPF JumpList And Thumbnail Toolbars.exe
WPF JumpList And Thumbnail Toolbars.vshost.exe
WPF JumpList And Thumbnail Toolbars.vshost.exe.manifest
Release
Commands
images
client.png
invoice.png
update.png
My Project
MyExtensions
Settings.settings
WPF JumpList And Thumbnail Toolbars.vbproj.user
WPF JumpList And Thumbnail Toolbars.suo
<Window x:Class="MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:viewModel="clr-namespace:WPF_JumpList_And_Thumbnail_Toolbars"
    Title="MainWindow" Height="350" Width="525">

    <Window.Resources>
        <DrawingImage x:Key="IconUpdate">
            <DrawingImage.Drawing>
                <ImageDrawing Rect="0,0,24,24" ImageSource="/Images/update.png" />
            </DrawingImage.Drawing>
        </DrawingImage>
        <DrawingImage x:Key="IconClient">
            <DrawingImage.Drawing>
                <ImageDrawing Rect="0,0,24,24" ImageSource="/Images/client.png" />
            </DrawingImage.Drawing>
        </DrawingImage>
        <DrawingImage x:Key="IconInvoice">
            <DrawingImage.Drawing>
                <ImageDrawing Rect="0,0,24,24" ImageSource="/Images/invoice.png" />
            </DrawingImage.Drawing>
        </DrawingImage>
    </Window.Resources>
    
    <Window.DataContext>
        <viewModel:ViewModel></viewModel:ViewModel>
    </Window.DataContext>

    <Window.TaskbarItemInfo>
        <TaskbarItemInfo>
            <TaskbarItemInfo.ThumbButtonInfos>
                <!-- Using Events -->
                <ThumbButtonInfo x:Name="btnUpdate"
                                 ImageSource="{StaticResource IconUpdate}"
                                 Description="Find updates for the application"
                                 IsBackgroundVisible="False"
                                 Click="btnUpdate_Click">
                </ThumbButtonInfo>
                <ThumbButtonInfo x:Name="btnClient"
                                 ImageSource="{StaticResource IconClient}"
                                 Description="Search Clients"
                                 IsBackgroundVisible="True"
                                 Click="btnClient_Click">
                </ThumbButtonInfo>
                <ThumbButtonInfo x:Name="btnInvoice"
                                 ImageSource="{StaticResource IconInvoice}"
                                 Description="Search Invoices"
                                 IsBackgroundVisible="True"
                                 IsEnabled="False"
                                 Click="btnInvoice_Click">
                </ThumbButtonInfo>

                <!--Using Commands -->
                <!--<ThumbButtonInfo x:Name="btnUpdate"
                                 ImageSource="{StaticResource IconUpdate}"
                                 Description="Find updates for the application"
                                 IsBackgroundVisible="True"
                                 Command="{Binding UpdateCommand}">
                </ThumbButtonInfo>
                <ThumbButtonInfo x:Name="btnClient"
                                 ImageSource="{StaticResource IconClient}"
                                 Description="Search Clients"
                                 IsBackgroundVisible="True"
                                 Command="{Binding ClientCommand}">
                </ThumbButtonInfo>
                <ThumbButtonInfo x:Name="btnInvoice"
                                 ImageSource="{StaticResource IconInvoice}"
                                 Description="Search Invoices"
                                 IsBackgroundVisible="True"
                                 Command="{Binding InvoiceCommnad}">
                </ThumbButtonInfo>-->
            </TaskbarItemInfo.ThumbButtonInfos>
        </TaskbarItemInfo>
    </Window.TaskbarItemInfo>

    <Grid>
        <Grid.Background>
            <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                <GradientStop Offset="0" Color="Black"></GradientStop>
                <GradientStop Offset="1" Color="DarkGray"></GradientStop>
            </LinearGradientBrush>
        </Grid.Background>
        <TabControl Margin="12,6,12,12" Name="TabControl1">
            <TabItem Header="JumpList" Name="TabItem1">
                <Grid AllowDrop="True">
                    <TextBlock Text="Select a menu option right clicking the taskbar icon" 
                               Margin="20" Name="Label1" Height="89.5" Width="439" Foreground="Cyan" ClipToBounds="False" FontSize="20" 
                               UseLayoutRounding="False" TextWrapping="Wrap" Padding="5" TextAlignment="Center" VerticalAlignment="Center" />
                </Grid>
            </TabItem>
            <TabItem Header="Thumbnail Toolbar" Name="TabItem2">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height=".33*"></RowDefinition>
                        <RowDefinition Height=".33*"></RowDefinition>
                        <RowDefinition Height=".33*"></RowDefinition>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Image Margin="5" Grid.Column="0" Grid.Row="0" Name="imgUpdate" Width="64" Height="64" Stretch="Uniform" 
                           Source="{StaticResource IconUpdate}">
                    </Image>
                    <Image Margin="5" Grid.Column="0" Grid.Row="1" Name="imgClient" Width="64" Height="64" Stretch="Uniform" 
                           Source="{StaticResource IconClient}">
                    </Image>
                    <Image Margin="5" Grid.Column="0" Grid.Row="2" Name="imgInvoice" Width="64" Height="64" Stretch="Uniform" 
                           Source="{StaticResource IconInvoice}">
                    </Image>
                </Grid>
            </TabItem>
        </TabControl>
    </Grid>
</Window>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

JOSUEYERAY
Software Developer Plain Concepts
Spain Spain
MCP - .NET Framework 2.0 Application Development Fundamentals
MCTS - .NET Framework 3.5 Windows Forms Application
MCTS - .NET Framework 3.5 Windows Presentation Foundation

| Advertise | Privacy | Mobile
Web03 | 2.8.140916.1 | Last Updated 3 Aug 2010
Article Copyright 2010 by JOSUEYERAY
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid