DotNET平台下添加JumpList
来源:互联网 发布:java 简单代码实例 编辑:程序博客网 时间:2024/05/01 17:59
XAML
<!--using System.Windows.Shell;--> <Application x:Class="WpfApplication.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml"> <Application.Resources> </Application.Resources> <JumpList.JumpList> <JumpList> <JumpTask Title="Open Notepad" Description="Open the Notepad Application" IconResourcePath="C:\Windows\Notepad.exe" IconResourceIndex="0" ApplicationPath="C:\Windows\Notepad.exe" /> </JumpList> </JumpList.JumpList></Application>
CSharp:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows;using System.Windows.Controls;using System.Windows.Data;using System.Windows.Documents;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Imaging;using System.Windows.Navigation;using System.Windows.Shapes;using System.Windows.Shell;namespace WpfApplication{ /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } private void Window_Loaded(object sender, RoutedEventArgs e) { // 创建一个新的JumpList JumpTask _JumpTask = new JumpTask(); _JumpTask.Title = "Open Notepad"; _JumpTask.Description = "Open the Notepad Application"; _JumpTask.ApplicationPath = @"C:\Windows\Notepad.exe"; _JumpTask.IconResourcePath = @"C:\Windows\Notepad.exe"; _JumpTask.IconResourceIndex = 0; // 获得当前的JumpList bool bExist = true; JumpList _JumpList = JumpList.GetJumpList(App.Current); if (_JumpList == null) { bExist = false; // 创建 JumpList _JumpList = new JumpList(); } // 添加JumpList _JumpList.JumpItems.Add(_JumpTask); // 更新 _JumpList.Apply(); // 如果之前没有JumpList则加入 if( !bExist ) { JumpList.SetJumpList(App.Current, _JumpList); } } }}
- DotNET平台下添加JumpList
- DotNet平台下WinForm窗体之间的相互操作
- 微软DotNet平台升温
- DotNet for Symbian平台
- 【dotnet跨平台】dotnet-cli典型场景
- 【dotnet跨平台】最新版dotnet-cli下的ASP.NET Core和asp.net mvc【RC2尝鲜】
- DotNet平台唯一实例运行
- dotNET跨平台 - CSDN博客
- dotnet下的采集
- 为自己的网站添加支持Win7 JumpList & IE9 Pinned Sites
- 【dotnet跨平台】"dotnet restore"和"dotnet run"都做了些什么?
- DotNet下连接VFP数据库
- dotNet下ActiveX的开发
- dotnet 下开发 COM+ 组件
- 手机操作系统实战DotNet for Symbian平台
- .NET Core 跨平台发布(dotnet publish)
- dotnet程序安装包添加卸载快捷方式
- wpf jumplist demo
- QT 控件 排版
- 大牛们的感悟笔记
- Servlet之ServletConfig和ServletContext的探索
- AVPlayer音量
- 老牌系统:雨一直下win7主题
- DotNET平台下添加JumpList
- MFC对话框
- iOS-Artwork-Extractor
- iOS动画
- android -h 'xcopy' 不是内部或外部命令
- 2013年6月工作小结-- 项目终验前的忙碌
- Linux操作系统是如何工作的?破解操作系统的奥秘
- VS2012 ddk驱动编译与虚拟机联机调试设置(已更新)
- uva 10201 Adventures in Moving - Part IV