`

Jumptlist in WPF and win7 explained

    博客分类:
  • C#
阅读更多

THis article is based on the study of the page http://wpftutorial.net/Jumplists.html

 

and it demonstrate the use of a cool feature that is called Jumplist which is avaialbe in Windows 7.

 

 

here is the code 

 

Introduction

Windows 7 provides a new taskbar feature for applications called jumplists. They appear, when you right-click on a application icon in the taskbar. By default you see a list of recent files opened and two entries to launch and detach the application.

.NET 4.0 provides a managed API that allows you to easily manipulate the entries in the jumplist.

How to add a Task to the Jumplist

A jumplist is nothing more than a categorizes list of links to files that can be launched by the user. The links are calledJumpTasks. They can be parametrized with a title, description, icon, filepath and command line arguments.

In the following sample I create a new JumpList and add a task to the list that launches the sample application, but with a command line argument. If the application is launched with an argument, it shows a MessageBox instead.

 
public partial class App : Application
{
    protected override void OnStartup(StartupEventArgs e)
    {
 
        if (e.Args.Count() > 0)
        {
            MessageBox.Show("You have the latest version.");
            Shutdown();
        }
 
        JumpTask task = new JumpTask
        {
            Title = "Check for Updates",
            Arguments = "/update",
            Description = "Cheks for Software Updates",
            CustomCategory = "Actions",
            IconResourcePath = Assembly.GetEntryAssembly().CodeBase,
            ApplicationPath = Assembly.GetEntryAssembly().CodeBase 
        };
 
        JumpList jumpList = new JumpList();
        jumpList.JumpItems.Add(task);
        jumpList.ShowFrequentCategory = false;
        jumpList.ShowRecentCategory = false;
 
        JumpList.SetJumpList(Application.Current, jumpList);
    }
}

 

 

 

With the above code, if you run the app, you will be able to see the following.

 

 

 

 

 

And if you click on the "CHeck for Updates", you will be able to see the MessageBox shown with the message "You have latest version"

分享到:
评论

相关推荐

    wpf仿win7界面

    wpf仿win7界面

    Packt.MVVM.Survival.Guide.for.Enterprise.Architectures.in.Silverlight.And.WPF

    Eliminate unnecessary code by taking advantage of the MVVM pattern in Silverlight and WPF using this book and eBook - less code, fewer bugs Build an enterprise application using Silverlight and WPF,...

    wpf仿win7效果

    在**仿Win7效果**的上下文中,我们讨论的是如何利用WPF来创建类似于Windows 7操作系统中的视觉元素和交互体验。这包括但不限于窗口边框、任务栏、Aero特效、玻璃透明效果、以及动态图标等。Windows 7的用户界面以其...

    WPF仿Win7便笺

    标题中的“WPF仿Win7便笺”指的是使用Windows Presentation Foundation (WPF)技术开发的一款模仿Windows 7操作系统中内置的便签应用的软件。WPF是微软.NET Framework的一部分,它提供了一个强大的图形用户界面(GUI...

    friendsofed foundation expression blend 2 building applications in wpf and silverlight

    friendsofed foundation expression blend 2 building applications in wpf and silverlightfriendsofed foundation expression blend 2 building applications in wpf and silverlight

    WPF 模仿Win7特效以及苹果部分特效

    在本文中,我们将深入探讨如何使用Windows Presentation Foundation(WPF)来模仿Windows 7和苹果操作系统的特定视觉特效。WPF是.NET Framework的一部分,它提供了一种强大的方式来创建具有丰富用户界面的桌面应用...

    WPF仿Windows7界面效果

    **WPF 仿Windows7界面效果详解** 在Windows Presentation Foundation(WPF)中,开发者可以利用丰富的图形渲染和用户界面设计能力来创建出与Windows7操作系统界面类似的视觉体验。WPF是.NET Framework的一部分,它...

    Pro WPF and Silverlight MVVM-English

    WPF and Silverlight are unlike any other user interface (UI) technologies. They have been built to a new paradigm that―if harnessed correctly―can yield unprecedented power and performance. This book...

    WPF win7计算器

    这是个自己根据win7写的WPF 类型的计算器,有意者可以下载研究研究,给予我宝贵意见。欢迎交流

    WPF创建win7多点触控应用程序

    **标题:“WPF创建win7多点触控应用程序”** 在Windows Presentation Foundation(WPF)框架下,开发针对Windows 7的多点触控应用程序是一项技术挑战,但也提供了丰富的交互体验。Windows 7引入了对多点触控硬件的...

    WPF and Silverlight MVVM

    In Chapter 1, WPF and Silverlight will be explored in some detail and their respective features highlighted. Chapter 2introduces the foundation of the MVVM pattern: the databinding model that ...

    WPF设计仿WIN7自带计算器

    **WPF设计仿Win7自带计算器详解** 在Windows Presentation Foundation(WPF)中设计一个仿Win7自带计算器的项目,可以让我们深入理解WPF的基本原理和控件使用,同时还能锻炼到事件处理、布局管理以及数据绑定等核心...

    WPF调用WIN10软键盘

    在Windows Presentation Foundation (WPF) 中,调用Win10软键盘是一项常见的需求,尤其是在开发触摸设备应用或者无物理键盘的交互式应用时。WPF是.NET Framework的一部分,用于构建具有丰富图形用户界面的应用程序。...

    Using SignalR in WinForms and WPF

    在这个主题中,“Using SignalR in WinForms and WPF”探讨了如何在Windows桌面应用环境中,即WinForms和WPF(Windows Presentation Foundation)中集成SignalR技术。 首先,SignalR的核心特性是它简化了服务器推送...

    Pro WPF 4.5 in C# WPF 编程宝典 2012和.NET4.5 第四版

    《Pro WPF 4.5 in C#》是WPF(Windows Presentation Foundation)编程的一本权威指南,由王德才翻译,主要针对2012年发布.NET Framework 4.5版本进行深入讲解。这本书详细阐述了使用C#语言进行WPF应用开发的各种技术...

    Pro WPF 4.5 in C# (Pro WPF系列第四版 英文书及其源代码)

    Packed with no-nonsense examples and practical advice you'll learn everything you need to know in order to use WPF in a professional setting. The book begins by building a firm foundation of ...

    WPF两种方式实现Win7样式时钟

    本文将详细讲解如何通过两种方法在WPF中实现具有Win7样式的时钟效果。 首先,我们要了解Win7时钟的特点,它通常具有清晰的数字显示、动态的秒针运动以及平滑的动画效果。在WPF中,我们可以利用两种主要技术来实现...

    WPF Page页仿Win7任务栏的快照导航,模拟Win7任务栏

    在本文中,我们将深入探讨如何使用WPF(Windows Presentation Foundation)技术来实现一个仿Win7任务栏的快照导航功能。我们将重点介绍关键组件VisualBrush,以及如何利用它来创建页面间的导航效果,同时也会提及...

    wpf 仿win8界面

    7. **响应式设计**:考虑到Win8支持多种设备尺寸,我们的WPF应用也应具备响应式布局。Grid控件的自动调整功能和Viewbox的缩放特性可以帮助我们实现这一目标。 8. **数据绑定和MVVM模式**:为了实现界面与业务逻辑的...

Global site tag (gtag.js) - Google Analytics