Windows 通用应用程序和托盘

Windows Universal Apps and tray

我打算编写一个 Windows 通用应用程序,它将 运行 放在托盘中。在托盘图标上会有一个包含多个选项的上下文菜单(用于添加新时间日志,用于关闭当前时间日志)。但是根据这个 post 不可能 运行 托盘中的 WUP。真的吗??

托盘是不是只能用于系统应用程序和旧式应用程序?

还有其他选择吗?要有固定任务栏图标的菜单项,可能是?

谢谢

据我所知,UWP 应用程序不可能有托盘图标。以前,Windows 应用程序设计为 运行 全屏模式。

如果这是一个 LOB 应用程序,您可以尝试使用代理组件来访问托盘图标功能。

谢谢,

通用应用程序无法将自己添加到通知区域,但最近的 Windows 10 更新使它们能够将项目添加到右键单击项目的任务栏图标或磁贴时显示的 JumpList

bool jumpListPresent = Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.UI.StartScreen.JumpList");
if (jumpListPresent && JumpList.IsSupported()) 
{
    JumpList jl = await JumpList.LoadCurrentAsync();
    jl.Items.Clear();
    JumpListItem jli = JumpListItem.CreateWithArguments("myJumpListItem", "my Jump List Item");
    jl.Items.Add(jli);
    await jl.SaveAsync();
}