简体   繁体   English

WPF JumpList在Windows 10中不起作用

[英]WPF JumpList is not working in Windows 10

I am trying to run custom commands from TaskBar using JumpTask in Windows 10 but it does not start the linked application. 我正在尝试在Windows 10中使用JumpTask从TaskBar运行自定义命令,但它不会启动链接的应用程序。 However it correctly displays the JumpTask link and it's icons. 但是,它可以正确显示JumpTask链接及其图标。 Here is the code that works correctly in Win7/Win8. 这是在Win7 / Win8中正常工作的代码。

JumpTask signOutTask = new JumpTask
{
    ApplicationPath = System.Reflection.Assembly.GetEntryAssembly().Location,
    Title = XXX.Properties.Resources.AccountContextMenu_SignOutText,
    Description = "Sign out of your account",
    CustomCategory = "Actions",
    Arguments = "/signout",
    IconResourcePath = System.Reflection.Assembly.GetEntryAssembly().Location,
    IconResourceIndex = 0
};

JumpList jumpList = new JumpList();
jumpList.JumpItems.Add(signOutTask);
jumpList.ShowFrequentCategory = false;
jumpList.ShowRecentCategory = false;

JumpList.SetJumpList(Application.Current, jumpList);

You need to update to Windows 10 Build 1511 (10586). 您需要更新到Windows 10 Build 1511(10586)。

JumpLists will Works like a charm. JumpLists会像魅力一样工作。

I ran into a similar problem trying to implement a JumpList under Win10. 我在尝试在Win10下实现JumpList时遇到了类似的问题。 With my app, I could add JumpList tasks with no problem ... they just wouldn't do anything. 使用我的应用程序,我可以毫无问题地添加JumpList任务……它们什么也做不了。 The really odd thing is that the JumpList started to work after I had Pinned my app to the task bar. 真正奇怪的是,在将应用程序固定到任务栏后,JumpList开始工作。 Repeated the experiment multiple times with the same result. 多次重复实验,结果相同。 App unpinned, JumpList didn't work ... App pinned, JumpList worked fine. 取消固定应用程序,JumpList不起作用。

So, I tried the same experiment with FireFox and Excel. 因此,我尝试使用FireFox和Excel进行相同的实验。 Both of these have no problem executing JumpList tasks ... Pinned or UnPinned. 两者都没有问题,可以执行JumpList任务...固定或未固定。

Clearly we are missing something. 显然,我们缺少了一些东西。 Not sure what. 不知道是什么。

I discovered that I could get mine to work again by modifying the Arguments property passed along to the application. 我发现可以通过修改传递给应用程序的Arguments属性来使我的代码再次工作。 I used the format @QUIT@, etc. to distinguish them from other parameters. 我使用了@ QUIT @等格式,以将其与其他参数区分开。

It seems like Win10 doesn't like the @ character, so I switched my parameters to |QUIT| 似乎Win10不喜欢@字符,因此我将参数切换为| QUIT |。 and it works again. 然后它再次起作用。

You are using "/signout", so I tested /QUIT. 您正在使用“ / signout”,所以我测试了/ QUIT。 That works on Win8.1 and Win10 for me. 对我来说,这适用于Win8.1和Win10。

I would still try removing special characters or using different ones and see if that makes a difference in your case. 我仍然会尝试删除特殊字符或使用其他字符,以查看是否对您有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM